Skip to content

Commit

Permalink
Merge pull request #276 from figsoda/update-deps
Browse files Browse the repository at this point in the history
bump dependencies
  • Loading branch information
marcospb19 committed Oct 11, 2022
2 parents fe0af16 + cc6b2c3 commit cd21ee9
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 29 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Categories Used:
- Update dependencies [\#257](https://github.com/ouch-org/ouch/pull/257) ([Artturin](https://github.com/Artturin))
- Add pull request template [\#263](https://github.com/ouch-org/ouch/pull/263) ([figsoda](https://github.com/figsoda))
- Clean up the description for the `-d/--dir` argument to `decompress` [\#264](https://github.com/ouch-org/ouch/pull/264) ([hivehand](https://github.com/hivehand))
- Update dependencies [\#276](https://github.com/ouch-org/ouch/pull/276) ([figsoda](https://github.com/figsoda))

### New Contributors

Expand Down
42 changes: 24 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ description = "A command-line utility for easily compressing and decompressing f
[dependencies]
atty = "0.2.14"
bzip2 = "0.4.3"
clap = { version = "4.0.9", features = ["derive", "env"] }
clap = { version = "4.0.13", features = ["derive", "env"] }
flate2 = { version = "1.0.24", default-features = false }
fs-err = "2.8.1"
libc = "0.2.134"
libc = "0.2.135"
linked-hash-map = "0.5.6"
lzzzz = "1.0.3"
once_cell = "1.15.0"
Expand All @@ -29,16 +29,16 @@ zip = { version = "0.6.2", default-features = false }
zstd = { version = "0.11.2", default-features = false }
tempfile = "3.3.0"
ignore = "0.4.18"
indicatif = "0.16.2"
indicatif = "0.17.1"

[target.'cfg(unix)'.dependencies]
time = { version = "0.3.14", default-features = false }
time = { version = "0.3.15", default-features = false }

[target.'cfg(not(unix))'.dependencies]
is_executable = "1.0.1"

[build-dependencies]
clap = { version = "4.0.9", features = ["derive", "env", "string"] }
clap = { version = "4.0.13", features = ["derive", "env", "string"] }
clap_complete = "4.0.2"
clap_mangen = "0.2.2"

Expand Down
9 changes: 8 additions & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ use std::{
fmt::{self, Display},
};

use indicatif::style::TemplateError;

use crate::{accessible::is_running_in_accessible_mode, utils::colors::*};

/// All errors that can be generated by `ouch`
#[derive(Debug, PartialEq, Eq)]
#[derive(Debug)]
pub enum Error {
/// Not every IoError, some of them get filtered by `From<io::Error>` into other variants
IoError { reason: String },
Expand All @@ -30,6 +32,8 @@ pub enum Error {
CompressingRootFolder,
/// Specialized walkdir's io::Error wrapper with additional information on the error
WalkdirError { reason: String },
/// TemplateError from
TemplateError(TemplateError),
/// Custom and unique errors are reported in this variant
Custom { reason: FinalError },
}
Expand Down Expand Up @@ -135,6 +139,9 @@ impl fmt::Display for Error {
FinalError::with_title(error_title.to_string()).detail("Permission denied")
}
Error::UnsupportedZipArchive(reason) => FinalError::with_title("Unsupported zip archive").detail(*reason),
Error::TemplateError(reason) => {
FinalError::with_title(reason.to_string()).detail("Progress bar template error")
}
Error::Custom { reason } => reason.clone(),
};

Expand Down
5 changes: 2 additions & 3 deletions src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ pub fn list_files(
if list_options.tree {
let pb = if !is_running_in_accessible_mode() {
let template = "{wide_msg} [{elapsed_precise}] {spinner:.green}";
let pb = ProgressBar::new_spinner();
pb.set_style(ProgressStyle::default_bar().template(template));
Some(pb)
let style = ProgressStyle::with_template(template).map_err(crate::Error::TemplateError)?;
Some(ProgressBar::new_spinner().with_style(style))
} else {
None
};
Expand Down
4 changes: 2 additions & 2 deletions src/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ impl Progress {
t += "({bytes_per_sec}, {eta}) {path}";
t
};
let bar = ProgressBar::new(total_input_size);
bar.set_style(ProgressStyle::default_bar().template(&template).progress_chars("#>-"));
let bar = ProgressBar::new(total_input_size)
.with_style(ProgressStyle::with_template(&template).unwrap().progress_chars("#>-"));

while draw_rx.try_recv().is_err() {
if let Some(ref pos_fn) = current_position_fn {
Expand Down

0 comments on commit cd21ee9

Please sign in to comment.