Просмотр исходного кода

refactor(clippy): simplify format strings

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Christina Sørensen 2 лет назад
Родитель
Сommit
8053415ae3
1 измененных файлов с 8 добавлено и 8 удалено
  1. 8 8
      src/main.rs

+ 8 - 8
src/main.rs

@@ -84,30 +84,30 @@ fn main() {
                 }
 
                 Err(e) if e.kind() == ErrorKind::BrokenPipe => {
-                    warn!("Broken pipe error: {}", e);
+                    warn!("Broken pipe error: {e}");
                     exit(exits::SUCCESS);
                 }
 
                 Err(e) => {
-                    eprintln!("{}", e);
+                    eprintln!("{e}");
                     exit(exits::RUNTIME_ERROR);
                 }
             }
         }
 
         OptionsResult::Help(help_text) => {
-            print!("{}", help_text);
+            print!("{help_text}");
         }
 
         OptionsResult::Version(version_str) => {
-            print!("{}", version_str);
+            print!("{version_str}");
         }
 
         OptionsResult::InvalidOptions(error) => {
-            eprintln!("exa: {}", error);
+            eprintln!("exa: {error}");
 
             if let Some(s) = error.suggestion() {
-                eprintln!("{}", s);
+                eprintln!("{s}");
             }
 
             exit(exits::OPTIONS_ERROR);
@@ -180,14 +180,14 @@ impl<'args> Exa<'args> {
             match File::from_args(PathBuf::from(file_path), None, None, self.options.view.deref_links) {
                 Err(e) => {
                     exit_status = 2;
-                    writeln!(io::stderr(), "{:?}: {}", file_path, e)?;
+                    writeln!(io::stderr(), "{file_path:?}: {e}")?;
                 }
 
                 Ok(f) => {
                     if f.points_to_directory() && ! self.options.dir_action.treat_dirs_as_files() {
                         match f.to_dir() {
                             Ok(d)   => dirs.push(d),
-                            Err(e)  => writeln!(io::stderr(), "{:?}: {}", file_path, e)?,
+                            Err(e)  => writeln!(io::stderr(), "{file_path:?}: {e}")?,
                         }
                     }
                     else {