mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
Merge pull request #1617 from sylvestre/clippy-fix
Fix some clippy warnings
This commit is contained in:
commit
58d7d89e07
4 changed files with 3 additions and 5 deletions
|
@ -676,7 +676,7 @@ fn filter_mount_list(vmi: Vec<MountInfo>, paths: &[String], opt: &Options) -> Ve
|
||||||
#[allow(clippy::map_entry)]
|
#[allow(clippy::map_entry)]
|
||||||
{
|
{
|
||||||
if acc.contains_key(&id) {
|
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();
|
let target_nearer_root = seen.mount_dir.len() > mi.mount_dir.len();
|
||||||
// With bind mounts, prefer items nearer the root of the source
|
// With bind mounts, prefer items nearer the root of the source
|
||||||
let source_below_root = !seen.mount_root.is_empty()
|
let source_below_root = !seen.mount_root.is_empty()
|
||||||
|
@ -694,7 +694,7 @@ fn filter_mount_list(vmi: Vec<MountInfo>, paths: &[String], opt: &Options) -> Ve
|
||||||
environments for example. */
|
environments for example. */
|
||||||
|| seen.mount_dir != mi.mount_dir)
|
|| seen.mount_dir != mi.mount_dir)
|
||||||
{
|
{
|
||||||
acc.get(&id).unwrap().replace(seen);
|
acc[&id].replace(seen);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
acc.insert(id, Cell::new(mi));
|
acc.insert(id, Cell::new(mi));
|
||||||
|
|
|
@ -32,7 +32,6 @@ fn tabstops_parse(s: String) -> Vec<usize> {
|
||||||
let words = s.split(',');
|
let words = s.split(',');
|
||||||
|
|
||||||
let nums = words
|
let nums = words
|
||||||
.into_iter()
|
|
||||||
.map(|sn| {
|
.map(|sn| {
|
||||||
sn.parse::<usize>()
|
sn.parse::<usize>()
|
||||||
.unwrap_or_else(|_| crash!(1, "{}\n", "tab size contains invalid character(s)"))
|
.unwrap_or_else(|_| crash!(1, "{}\n", "tab size contains invalid character(s)"))
|
||||||
|
|
|
@ -131,7 +131,7 @@ impl Graph {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn has_edge(&self, from: &str, to: &str) -> bool {
|
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) {
|
fn init_node(&mut self, n: &str) {
|
||||||
|
|
|
@ -29,7 +29,6 @@ fn tabstops_parse(s: String) -> Vec<usize> {
|
||||||
let words = s.split(',');
|
let words = s.split(',');
|
||||||
|
|
||||||
let nums = words
|
let nums = words
|
||||||
.into_iter()
|
|
||||||
.map(|sn| {
|
.map(|sn| {
|
||||||
sn.parse()
|
sn.parse()
|
||||||
.unwrap_or_else(|_| crash!(1, "{}\n", "tab size contains invalid character(s)"))
|
.unwrap_or_else(|_| crash!(1, "{}\n", "tab size contains invalid character(s)"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue