Conversation
jaemk
left a comment
There was a problem hiding this comment.
awesome thanks! Just a few small thing
| io::copy(&mut file, &mut output)?; | ||
| let outpath = into_dir.join(file.sanitized_name()); | ||
|
|
||
| if (&*file.name()).ends_with('/') { |
There was a problem hiding this comment.
can you use outpath.is_dir() instead to be windows compatible
There was a problem hiding this comment.
That was copy pasted from zip-rs example, but yes I can.
There was a problem hiding this comment.
Doing that causes the program to think everything is a file. I think this is mostly due to zip-rs handling folders as files and only making the difference using the ending /.
There was a problem hiding this comment.
hm, that's unfortunate... Do you know if that's also the case on windows? Could you maybe setup a test zip file with nested dirs and add windows-cfg'd/linux-cfg'd tests that check this?
There was a problem hiding this comment.
I think the reason for the is_dir to not work is because of the sanitized_name call, which might be removing the trailing slash.
I'm a bit(very) short on time currently, so I don't want to spend a lot of time on this bug fix writing unit tests. Sorry!
src/lib.rs
Outdated
| let outpath = into_dir.join(file.sanitized_name()); | ||
|
|
||
| if (&*file.name()).ends_with('/') { | ||
| fs::create_dir_all(&outpath).unwrap(); |
There was a problem hiding this comment.
can you use the ? operator instead of unwraps
Hello there!
Really cool crate, I like it a lot! I'll probably open more pull requests as I go.