diff --git a/src/uu/df/src/df.rs b/src/uu/df/src/df.rs index 0f9f440e2..d1541866d 100644 --- a/src/uu/df/src/df.rs +++ b/src/uu/df/src/df.rs @@ -676,7 +676,7 @@ fn filter_mount_list(vmi: Vec, paths: &[String], opt: &Options) -> Ve #[allow(clippy::map_entry)] { if acc.contains_key(&id) { - let seen = acc.get(&id).unwrap().replace(mi.clone()); + let seen = acc[&id].replace(mi.clone()); let target_nearer_root = seen.mount_dir.len() > mi.mount_dir.len(); // With bind mounts, prefer items nearer the root of the source let source_below_root = !seen.mount_root.is_empty() @@ -694,7 +694,7 @@ fn filter_mount_list(vmi: Vec, paths: &[String], opt: &Options) -> Ve environments for example. */ || seen.mount_dir != mi.mount_dir) { - acc.get(&id).unwrap().replace(seen); + acc[&id].replace(seen); } } else { acc.insert(id, Cell::new(mi)); diff --git a/src/uu/expand/src/expand.rs b/src/uu/expand/src/expand.rs index d478c3c73..e44282974 100644 --- a/src/uu/expand/src/expand.rs +++ b/src/uu/expand/src/expand.rs @@ -32,7 +32,6 @@ fn tabstops_parse(s: String) -> Vec { let words = s.split(','); let nums = words - .into_iter() .map(|sn| { sn.parse::() .unwrap_or_else(|_| crash!(1, "{}\n", "tab size contains invalid character(s)")) diff --git a/src/uu/tsort/src/tsort.rs b/src/uu/tsort/src/tsort.rs index e8a1010e1..dc7785645 100644 --- a/src/uu/tsort/src/tsort.rs +++ b/src/uu/tsort/src/tsort.rs @@ -131,7 +131,7 @@ impl Graph { } fn has_edge(&self, from: &str, to: &str) -> bool { - self.in_edges.get(to).unwrap().contains(from) + self.in_edges[to].contains(from) } fn init_node(&mut self, n: &str) { diff --git a/src/uu/unexpand/src/unexpand.rs b/src/uu/unexpand/src/unexpand.rs index d15e3f73c..57aa29b0a 100644 --- a/src/uu/unexpand/src/unexpand.rs +++ b/src/uu/unexpand/src/unexpand.rs @@ -29,7 +29,6 @@ fn tabstops_parse(s: String) -> Vec { let words = s.split(','); let nums = words - .into_iter() .map(|sn| { sn.parse() .unwrap_or_else(|_| crash!(1, "{}\n", "tab size contains invalid character(s)"))