1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #7640 from cakebaker/clippy_fix_warnings_from_rust_1_86

clippy: fix warnings from Rust 1.86
This commit is contained in:
Sylvestre Ledru 2025-04-03 16:38:07 +02:00 committed by GitHub
commit 2cfed639d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 7 additions and 7 deletions

View file

@ -157,7 +157,7 @@ mod tests {
]; ];
for (line, final_len) in tests { for (line, final_len) in tests {
let mut v = std::iter::repeat(b'a').take(line).collect::<Vec<_>>(); let mut v = std::iter::repeat_n(b'a', line).collect::<Vec<_>>();
prepare_buffer(&mut v); prepare_buffer(&mut v);
assert_eq!(v.len(), final_len); assert_eq!(v.len(), final_len);
} }

View file

@ -5637,7 +5637,7 @@ mod link_deref {
let mut args = vec!["--link", "-P", src, DST]; let mut args = vec!["--link", "-P", src, DST];
if r { if r {
args.push("-R"); args.push("-R");
}; }
scene.ucmd().args(&args).succeeds().no_stderr(); scene.ucmd().args(&args).succeeds().no_stderr();
at.is_symlink(DST); at.is_symlink(DST);
let src_ino = at.symlink_metadata(src).ino(); let src_ino = at.symlink_metadata(src).ino();
@ -5658,7 +5658,7 @@ mod link_deref {
let mut args = vec!["--link", DANG_LINK, DST]; let mut args = vec!["--link", DANG_LINK, DST];
if r { if r {
args.push("-R"); args.push("-R");
}; }
if !option.is_empty() { if !option.is_empty() {
args.push(option); args.push(option);
} }

View file

@ -7,7 +7,7 @@
use uutests::at_and_ucmd; use uutests::at_and_ucmd;
use uutests::new_ucmd; use uutests::new_ucmd;
use uutests::util::TestScenario; use uutests::util::TestScenario;
#[cfg(unix)] #[cfg(all(unix, not(feature = "feat_selinux")))]
use uutests::util::run_ucmd_as_root_with_stdin_stdout; use uutests::util::run_ucmd_as_root_with_stdin_stdout;
#[cfg(all(not(windows), feature = "printf"))] #[cfg(all(not(windows), feature = "printf"))]
use uutests::util::{UCommand, get_tests_binary}; use uutests::util::{UCommand, get_tests_binary};

View file

@ -185,7 +185,7 @@ fn test_random() {
factors.push(factor); factors.push(factor);
} }
None => break, None => break,
}; }
} }
factors.sort_unstable(); factors.sort_unstable();

View file

@ -1374,9 +1374,9 @@ pub struct TerminalSimulation {
/// A `UCommand` is a builder wrapping an individual Command that provides several additional features: /// A `UCommand` is a builder wrapping an individual Command that provides several additional features:
/// 1. it has convenience functions that are more ergonomic to use for piping in stdin, spawning the command /// 1. it has convenience functions that are more ergonomic to use for piping in stdin, spawning the command
/// and asserting on the results. /// and asserting on the results.
/// 2. it tracks arguments provided so that in test cases which may provide variations of an arg in loops /// 2. it tracks arguments provided so that in test cases which may provide variations of an arg in loops
/// the test failure can display the exact call which preceded an assertion failure. /// the test failure can display the exact call which preceded an assertion failure.
/// 3. it provides convenience construction methods to set the Command uutils utility and temporary directory. /// 3. it provides convenience construction methods to set the Command uutils utility and temporary directory.
/// ///
/// Per default `UCommand` runs a command given as an argument in a shell, platform independently. /// Per default `UCommand` runs a command given as an argument in a shell, platform independently.