mirror of
https://github.com/uutils/procps.git
synced 2026-05-06 06:06:43 -04:00
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:
@@ -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")]
|
||||
|
||||
Reference in New Issue
Block a user