Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ pub fn check_mime_type(
.ends_with(detected_format.compression_formats)
{
warning(format!(
"The file extension: `{}` differ from the detected extension: `{}`",
outer_ext, detected_format
"The file extension: `{outer_ext}` differ from the detected extension: `{detected_format}`"
));

if !user_wants_to_continue(path, question_policy, QuestionAction::Decompression)? {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/decompress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ pub fn decompress_file(options: DecompressOptions) -> crate::Result<()> {
"Successfully decompressed archive in {}",
nice_directory_display(options.output_dir)
));
info_accessible(format!("Files unpacked: {}", files_unpacked));
info_accessible(format!("Files unpacked: {files_unpacked}"));

if !input_is_stdin && options.remove {
fs::remove_file(options.input_file_path)?;
Expand Down
4 changes: 2 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ impl FinalError {
/// hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst
/// ```
pub fn hint_all_supported_formats(self) -> Self {
self.hint(format!("Supported extensions are: {}", PRETTY_SUPPORTED_EXTENSIONS))
.hint(format!("Supported aliases are: {}", PRETTY_SUPPORTED_ALIASES))
self.hint(format!("Supported extensions are: {PRETTY_SUPPORTED_EXTENSIONS}"))
.hint(format!("Supported aliases are: {PRETTY_SUPPORTED_ALIASES}"))
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ pub fn parse_format_flag(input: &OsStr) -> crate::Result<Vec<Extension>> {
.map(|extension| {
to_extension(extension.as_bytes()).ok_or_else(|| Error::InvalidFormatFlag {
text: input.to_owned(),
reason: format!("Unsupported extension '{}'", extension),
reason: format!("Unsupported extension '{extension}'"),
})
})
.collect::<crate::Result<_>>()?;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl std::fmt::Display for Bytes {

debug_assert!(num >= 0.0);
if num < 1_f64 {
return write!(f, "{:>6.2} B", num);
return write!(f, "{num:>6.2} B");
}

let delimiter = 1000_f64;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub fn rename_or_increment_filename(path: &Path) -> PathBuf {
let number = number_str.parse::<u32>().unwrap_or(0);
format!("{}_{}", base, number + 1)
}
_ => format!("{}_1", filename),
_ => format!("{filename}_1"),
};

let mut new_path = parent.join(new_filename);
Expand Down
8 changes: 4 additions & 4 deletions src/utils/question.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl<'a, T: Default> ChoicePrompt<'a, T> {

#[cfg(not(feature = "allow_piped_choice"))]
if !stdin().is_terminal() {
eprintln!("{}", message);
eprintln!("{message}");
eprintln!("Pass --yes to proceed");
return Ok(T::default());
}
Expand Down Expand Up @@ -222,10 +222,10 @@ impl<'a, T: Default> ChoicePrompt<'a, T> {
.collect::<Vec<_>>()
.join("/");

format!("[{}]", choises)
format!("[{choises}]")
};

eprintln!("{} {}", message, choice_prompt);
eprintln!("{message} {choice_prompt}");

let mut answer = String::new();
let bytes_read = stdin_lock.read_line(&mut answer)?;
Expand Down Expand Up @@ -284,7 +284,7 @@ impl<'a> Confirmation<'a> {

#[cfg(not(feature = "allow_piped_choice"))]
if !stdin().is_terminal() {
eprintln!("{}", message);
eprintln!("{message}");
eprintln!("Pass --yes to proceed");
return Ok(false);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ fn single_file_stdin(
fs::create_dir(before).unwrap();
let before_file = &before.join("file");
let format = merge_extensions(&ext, &exts);
let archive = &dir.join(format!("file.{}", format));
let archive = &dir.join(format!("file.{format}"));
let after = &dir.join("after");
write_random_content(
&mut fs::File::create(before_file).unwrap(),
Expand Down
Loading