Skip to content

Commit b7805b3

Browse files
committed
chore(clippy): fix clippy warnings
1 parent c8bcdb9 commit b7805b3

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

src/uucore/src/lib/features/backup_control.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -667,37 +667,34 @@ mod tests {
667667

668668
#[test]
669669
fn test_numbered_backup_path() {
670-
assert_eq!(numbered_backup_path(&Path::new("")), PathBuf::from(".~1~"));
670+
assert_eq!(numbered_backup_path(Path::new("")), PathBuf::from(".~1~"));
671+
assert_eq!(numbered_backup_path(Path::new("/")), PathBuf::from("/.~1~"));
671672
assert_eq!(
672-
numbered_backup_path(&Path::new("/")),
673-
PathBuf::from("/.~1~")
674-
);
675-
assert_eq!(
676-
numbered_backup_path(&Path::new("/hello/world")),
673+
numbered_backup_path(Path::new("/hello/world")),
677674
PathBuf::from("/hello/world.~1~")
678675
);
679676
assert_eq!(
680-
numbered_backup_path(&Path::new("/hello/world/")),
677+
numbered_backup_path(Path::new("/hello/world/")),
681678
PathBuf::from("/hello/world.~1~")
682679
);
683680
}
684681

685682
#[test]
686683
fn test_simple_backup_path() {
687684
assert_eq!(
688-
simple_backup_path(&Path::new(""), ".bak"),
685+
simple_backup_path(Path::new(""), ".bak"),
689686
PathBuf::from(".bak")
690687
);
691688
assert_eq!(
692-
simple_backup_path(&Path::new("/"), ".bak"),
689+
simple_backup_path(Path::new("/"), ".bak"),
693690
PathBuf::from("/.bak")
694691
);
695692
assert_eq!(
696-
simple_backup_path(&Path::new("/hello/world"), ".bak"),
693+
simple_backup_path(Path::new("/hello/world"), ".bak"),
697694
PathBuf::from("/hello/world.bak")
698695
);
699696
assert_eq!(
700-
simple_backup_path(&Path::new("/hello/world/"), ".bak"),
697+
simple_backup_path(Path::new("/hello/world/"), ".bak"),
701698
PathBuf::from("/hello/world.bak")
702699
);
703700
}

src/uucore/src/lib/features/proc_info.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
//! `snice` (TBD)
2020
//!
2121
22+
// This file is currently flagged as dead code, because it isn't used anywhere
23+
// in the codebase. It may be useful in the future though, so we decide to keep
24+
// it.
25+
#![allow(dead_code)]
26+
2227
use crate::features::tty::Teletype;
2328
use std::hash::Hash;
2429
use std::{

0 commit comments

Comments
 (0)