1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 12:37:49 +00:00

chore(clippy): fix clippy warnings

This commit is contained in:
Dorian Péron 2024-12-07 00:18:18 +01:00 committed by Dorian Peron
parent edf8be5e08
commit 0a0db41a2c
2 changed files with 17 additions and 11 deletions

View file

@ -667,17 +667,14 @@ mod tests {
#[test]
fn test_numbered_backup_path() {
assert_eq!(numbered_backup_path(&Path::new("")), PathBuf::from(".~1~"));
assert_eq!(numbered_backup_path(Path::new("")), PathBuf::from(".~1~"));
assert_eq!(numbered_backup_path(Path::new("/")), PathBuf::from("/.~1~"));
assert_eq!(
numbered_backup_path(&Path::new("/")),
PathBuf::from("/.~1~")
);
assert_eq!(
numbered_backup_path(&Path::new("/hello/world")),
numbered_backup_path(Path::new("/hello/world")),
PathBuf::from("/hello/world.~1~")
);
assert_eq!(
numbered_backup_path(&Path::new("/hello/world/")),
numbered_backup_path(Path::new("/hello/world/")),
PathBuf::from("/hello/world.~1~")
);
}
@ -685,19 +682,19 @@ mod tests {
#[test]
fn test_simple_backup_path() {
assert_eq!(
simple_backup_path(&Path::new(""), ".bak"),
simple_backup_path(Path::new(""), ".bak"),
PathBuf::from(".bak")
);
assert_eq!(
simple_backup_path(&Path::new("/"), ".bak"),
simple_backup_path(Path::new("/"), ".bak"),
PathBuf::from("/.bak")
);
assert_eq!(
simple_backup_path(&Path::new("/hello/world"), ".bak"),
simple_backup_path(Path::new("/hello/world"), ".bak"),
PathBuf::from("/hello/world.bak")
);
assert_eq!(
simple_backup_path(&Path::new("/hello/world/"), ".bak"),
simple_backup_path(Path::new("/hello/world/"), ".bak"),
PathBuf::from("/hello/world.bak")
);
}

View file

@ -19,6 +19,15 @@
//! `snice` (TBD)
//!
// This file is currently flagged as dead code, because it isn't used anywhere
// in the codebase. It may be useful in the future though, so we decide to keep
// it.
// The code was originally written in procps
// (https://github.com/uutils/procps/blob/main/src/uu/pgrep/src/process.rs)
// but was eventually moved here.
// See https://github.com/uutils/coreutils/pull/6932 for discussion.
#![allow(dead_code)]
use crate::features::tty::Teletype;
use std::hash::Hash;
use std::{