Skip to content

Commit

Permalink
fixup! feat: add support to iterator over encrypted zip
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
  • Loading branch information
otavio committed Jun 1, 2023
1 parent f01be1a commit a6098c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/iterator.rs
Expand Up @@ -44,7 +44,7 @@ pub enum ArchiveContents {
/// The entry is processed on a return value of `true` and ignored on `false`.
pub type EntryFilterCallbackFn = dyn Fn(&str, &libc::stat) -> bool;

pub struct ArchivePassword(Vec<u8>);
pub struct ArchivePassword(CString);

impl ArchivePassword {
pub fn extract(&self) -> *const i8 {
Expand All @@ -54,7 +54,7 @@ impl ArchivePassword {

impl<T> From<T> for ArchivePassword where T: AsRef<str> {
fn from(s: T) -> Self {
Self(s.as_ref().as_bytes().to_vec())
Self(CString::new(s.as_ref()).unwrap())
}
}

Expand Down

0 comments on commit a6098c8

Please sign in to comment.