Skip to content
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

Housekeeping/clippy 2 #34

Merged
merged 10 commits into from
Sep 18, 2024
Merged

Housekeeping/clippy 2 #34

merged 10 commits into from
Sep 18, 2024

Conversation

toastxc
Copy link
Collaborator

@toastxc toastxc commented Sep 9, 2024

No description provided.

@toastxc
Copy link
Collaborator Author

toastxc commented Sep 9, 2024

You're gonna want to look at the recent commits.
they are less indented but you may not like it

@ktwrd
Copy link
Owner

ktwrd commented Sep 9, 2024

Looks good except that in crate::extract::unpack_tarball, pb.finish(); is never called which will will cause issues.

this should be called if the function returns at any point after the progress bar is created.

@toastxc
Copy link
Collaborator Author

toastxc commented Sep 9, 2024

I'd like to add that this is a draft: will complete laterrrrr.

@ktwrd
Copy link
Owner

ktwrd commented Sep 10, 2024

I'd like to add that this is a draft: will complete laterrrrr.

then make the PR a draft 🤓

@ktwrd
Copy link
Owner

ktwrd commented Sep 15, 2024

@toastxc Resolved merge conflicts :3

@ktwrd ktwrd mentioned this pull request Sep 15, 2024
src/extract.rs Outdated
let decoder = ZstdDecoder::new(zstd_file)?;
// estimate extracted size as x2 since idk how to get the decompressed size with
// zstd
let pb_decompress = ProgressBar::new((zstd_file_length.clone() * 2) as u64);
let pb_decompress = ProgressBar::new((*zstd_file_length * 2));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unnecessary parentheses around function argument
   --> src\extract.rs:121:46
    |
121 |         let pb_decompress = ProgressBar::new((*zstd_file_length * 2));
    |                                              ^                     ^
    |
    = note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
    |
121 -         let pb_decompress = ProgressBar::new((*zstd_file_length * 2));
121 +         let pb_decompress = ProgressBar::new(*zstd_file_length * 2);
    |

}
Err(e) =>
{
Err(error) => {
return Err(BeansError::TarExtractFailure {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pb.finish(); should be called before return Err(

}
}
if let Err(error) = x.unpack_in(&output_directory) {
return Err(BeansError::TarUnpackItemFailure {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pb.finish(); should be called before return Err(

let entries = match archive.entries() {
Ok(a) => a,
Err(error) => {
return Err(BeansError::TarExtractFailure {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pb.finish(); should be called before return Err(

@ktwrd ktwrd merged commit 6926b0d into develop Sep 18, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants