tenseleyflow/bencch / 284d89e

Browse files

fix clippy: box RunConfig variant, elide lifetime, inline format arg

Authored by espadonne
SHA
284d89e8c48e649081e4729b8b8bf59800cf548f
Parents
96afcc7
Tree
c3a618c

1 changed file

StatusFile+-
M bench/src/lib.rs 5 5
bench/src/lib.rsmodified
@@ -488,7 +488,7 @@ pub fn run_cli(args: &[String]) -> i32 {
488488
 
489489
 enum CommandKind {
490490
     List { suite_filter: Option<String> },
491
-    Run(RunConfig),
491
+    Run(Box<RunConfig>),
492492
     Help,
493493
 }
494494
 
@@ -575,7 +575,7 @@ fn parse_cli(args: &[String]) -> Result<CommandKind, String> {
575575
                     other => return Err(format!("unknown run option: {}", other)),
576576
                 }
577577
             }
578
-            Ok(CommandKind::Run(config))
578
+            Ok(CommandKind::Run(Box::new(config)))
579579
         }
580580
         "--help" | "-h" | "help" => Ok(CommandKind::Help),
581581
         other => Err(format!("unknown command: {}", other)),
@@ -3668,7 +3668,7 @@ fn capture_run_from_testing(source: &Path, opt_level: OptLevel) -> Result<RunCap
36683668
     capture_run_stage(&result).cloned()
36693669
 }
36703670
 
3671
-fn capture_text_stage<'a>(result: &'a CaptureResult, stage: Stage) -> Result<&'a str, String> {
3671
+fn capture_text_stage(result: &CaptureResult, stage: Stage) -> Result<&str, String> {
36723672
     match result.get(stage) {
36733673
         Some(CapturedStage::Text(text)) => Ok(text),
36743674
         Some(CapturedStage::Run(_)) => Err(format!(
@@ -4066,9 +4066,9 @@ fn describe_object_difference(
40664066
     let (first_name, first_expected, first_actual) = differing[0];
40674067
 
40684068
     format!(
4069
-        "differing object components: {}\n{}\n{}",
4069
+        "differing object components: {}\nfirst differing component: {}\n{}",
40704070
         component_list,
4071
-        format!("first differing component: {}", first_name),
4071
+        first_name,
40724072
         describe_text_difference(first_expected, first_actual, left_label, right_label)
40734073
     )
40744074
 }