Skip to content

Commit

Permalink
ci: clippy suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Devdutt Shenoi committed Aug 29, 2024
1 parent 6fb5c1a commit ddf3200
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tools/system-stats/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ pub struct System {
impl System {
fn init(sys: &sysinfo::System) -> System {
System {
kernel_version: match sys.kernel_version() {
Some(kv) => kv,
None => String::default(),
},
kernel_version: sys.kernel_version().unwrap_or_default(),
total_memory: sys.total_memory(),
..Default::default()
}
Expand Down Expand Up @@ -622,7 +619,7 @@ impl StatCollector {
self.sys.refresh_processes();
let timestamp = clock();
for (&id, p) in self.sys.processes() {
let name = p.cmd().get(0).map(|s| s.to_string()).unwrap_or(p.name().to_string());
let name = p.cmd().first().map(|s| s.to_string()).unwrap_or(p.name().to_string());

if self.config.process_names.contains(&name) {
let payload = self.processes.push(id.as_u32(), p, name, timestamp);
Expand Down

0 comments on commit ddf3200

Please sign in to comment.