From 7b329d4b106c6023f9740d835e6cbc453ee536e2 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Mon, 3 Nov 2025 00:37:17 +0200 Subject: [PATCH] vmstat: Fix clippy error error: implicitly cloning a `String` by calling `to_string` on its dereferenced type --> src/uu/vmstat/src/picker.rs:327:16 | 327 | vec![(len, runnable.to_string()), (len, blocked.to_string())] | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `runnable.clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#implicit_clone = note: `-D clippy::implicit-clone` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::implicit_clone)]` error: implicitly cloning a `String` by calling `to_string` on its dereferenced type --> src/uu/vmstat/src/picker.rs:327:45 | 327 | vec![(len, runnable.to_string()), (len, blocked.to_string())] | ^^^^^^^^^^^^^^^^^^^ help: consider using: `blocked.clone()` --- src/uu/vmstat/src/picker.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/vmstat/src/picker.rs b/src/uu/vmstat/src/picker.rs index b75c7ae..036c2e4 100644 --- a/src/uu/vmstat/src/picker.rs +++ b/src/uu/vmstat/src/picker.rs @@ -324,7 +324,7 @@ fn get_process_info( let blocked = proc_data.stat.get("procs_blocked").unwrap(); let len = if matches.get_flag("wide") { 4 } else { 2 }; - vec![(len, runnable.to_string()), (len, blocked.to_string())] + vec![(len, runnable.clone()), (len, blocked.clone())] } #[cfg(target_os = "linux")]