-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZIP #118
ZIP #118
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some test cases would be nice :)
There is a bug involved in the old unzip logic, where the function does a diff of the destination dir before and after the unzip. So if the unzip overwrote some files, the file paths are not returned. The desired behavior will be to get the content of the archive (listing the files in the temp dir) |
let archive = unrar::Archive::new(file.to_str().ok_or_else(|| eyre!("Non-unicode character in file name {}", file.display()))?.to_string()); | ||
archive | ||
.extract_to(temp_dest.to_str().ok_or_else(|| eyre!("Non-unicode character in file name {}", temp_dest.display()))?.to_string()) | ||
.map_err(|_| eyre!("Failed to decompress file {}", file.display()))? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use .context
.extract_to(temp_dest.to_str().ok_or_else(|| eyre!("Non-unicode character in file name {}", temp_dest.display()))?.to_string()) | ||
.map_err(|_| eyre!("Failed to decompress file {}", file.display()))? | ||
.process() | ||
.map_err(|_| eyre!("Failed to decompress file {}", file.display()))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: the following trait bounds were not satisfied:
UnrarError<Vec<unrar::archive::Entry>>: eyre::context::ext::StdError
They didn't make their error type good I guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add test case for .tar.gz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please install clippy and watch out for minor details such as unused deps
Description
ZIP
Type of change
Note: make sure your files are formatted with rust-analyzer