]> git.r.bdr.sh - rbdr/blog/blobdiff - src/main.rs
Deal with all lints
[rbdr/blog] / src / main.rs
index 6c529ed216ac3f7c91cb353c10e63eeb7db376fc..ae3628972afba8792136050553bdddd010cd169f 100644 (file)
@@ -22,9 +22,9 @@ fn main() -> Result<()> {
         result
     } else {
         match result {
-            Ok(_) => Ok(()),
+            Ok(()) => Ok(()),
             Err(e) => {
-                eprintln!("{}", e);
+                eprintln!("{e}");
                 std::process::exit(1);
             }
         }
@@ -44,19 +44,16 @@ fn run() -> Result<()> {
             let command_chain: Vec<Box<dyn Command>> = before_commands
                 .into_iter()
                 .chain(once(main_command))
-                .chain(after_commands.into_iter())
+                .chain(after_commands)
                 .collect();
 
             for command in command_chain {
-                let result = command.execute(arguments.get(2), &configuration, command_name);
-                if let Err(_) = result {
-                    return result;
-                }
+                command.execute(arguments.get(2), &configuration, command_name)?;
             }
 
             return Ok(());
         }
     }
 
-    Help::new().execute(None, &configuration, &"help".to_string())
+    Help::new().execute(None, &configuration, "help")
 }