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()`
This commit is contained in:
Tuomas Tynkkynen
2025-11-03 00:37:17 +02:00
parent 55c96c716a
commit 7b329d4b10
+1 -1
View File
@@ -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")]