From 1b16c6c73f265fab90b76a1988e5a4a3d20d3d80 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bennet=20Ble=C3=9Fmann?= Date: Sat, 6 Jul 2024 13:03:14 +0200 Subject: [PATCH] clippy: use clone_from rather than clone --- src/machine/lib_machine.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/machine/lib_machine.rs b/src/machine/lib_machine.rs index 938a5597..27909c8a 100644 --- a/src/machine/lib_machine.rs +++ b/src/machine/lib_machine.rs @@ -191,7 +191,7 @@ impl Machine { printer.quoted = true; printer.max_depth = 1000; // NOTE: set this to 0 for unbounded depth printer.double_quotes = true; - printer.var_names = var_names.clone(); + printer.var_names.clone_from(&var_names); let outputter = printer.print(); @@ -488,12 +488,8 @@ mod tests { } else if let Some(result) = block.strip_prefix("result") { i += 1; if let Some(Ok(ref last_result)) = last_result { - println!( - "\n\n=====Result No. {}=======\n{}\n===============", - i, - last_result.to_string().trim() - ); - assert_eq!(last_result.to_string().trim(), result.to_string().trim(),) + println!("\n\n=====Result No. {i}=======\n{last_result}\n==============="); + assert_eq!(last_result.to_string(), result.to_string().trim(),) } } } -- 2.54.0