1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 19:36:16 +00:00

clippy fixes

This commit is contained in:
Jeffrey Finkelstein 2022-10-23 00:18:56 -04:00
parent 418518a443
commit 55b3766c10
22 changed files with 95 additions and 92 deletions

View file

@ -708,7 +708,7 @@ fn test_chown_file_notexisting() {
.fails();
// TODO: uncomment once "failed to change ownership of '{}' to {}" added to stdout
// result.stderr_contains(&"retained as");
// result.stderr_contains("retained as");
// TODO: uncomment once message changed from "cannot dereference" to "cannot access"
// result.stderr_contains(&"cannot access 'not_existing': No such file or directory");
// result.stderr_contains("cannot access 'not_existing': No such file or directory");
}

View file

@ -1863,7 +1863,7 @@ fn test_ls_recursive() {
#[cfg(not(windows))]
result.stdout_contains("a/b:\nb");
#[cfg(windows)]
result.stdout_contains(&"a\\b:\nb");
result.stdout_contains("a\\b:\nb");
}
#[test]
@ -2093,13 +2093,13 @@ fn test_ls_indicator_style() {
.ucmd()
.arg(format!("--indicator-style={}", opt))
.succeeds()
.stdout_contains(&"/");
.stdout_contains("/");
}
// Same test as above, but with the alternate flags.
let options = vec!["--classify", "--file-type", "-p"];
for opt in options {
scene.ucmd().arg(opt).succeeds().stdout_contains(&"/");
scene.ucmd().arg(opt).succeeds().stdout_contains("/");
}
// Classify and File-Type all contain indicators for pipes and links.
@ -2110,7 +2110,7 @@ fn test_ls_indicator_style() {
.ucmd()
.arg(format!("--indicator-style={}", opt))
.succeeds()
.stdout_contains(&"@");
.stdout_contains("@");
}
}
@ -3195,7 +3195,7 @@ fn test_ls_context_format() {
] {
let format = format!("--format={}", word);
ts.ucmd()
.args(&[&"-Z", &format.as_str(), &"/"])
.args(&["-Z", format.as_str(), "/"])
.succeeds()
.stdout_only(
unwrap_or_return!(expected_result(&ts, &["-Z", format.as_str(), "/"])).stdout_str(),

View file

@ -58,11 +58,11 @@ impl Distribution<u8> for AlphanumericNewline {
/// use rand::distributions::Alphanumeric;
///
/// // generates a 100 byte string with characters from AlphanumericNewline
/// let random_string = RandomString::generate(&AlphanumericNewline, 100);
/// let random_string = RandomString::generate(AlphanumericNewline, 100);
/// assert_eq!(100, random_string.len());
///
/// // generates a 100 byte string with 10 newline characters not ending with a newline
/// let string = RandomString::generate_with_delimiter(&Alphanumeric, b'\n', 10, false, 100);
/// let string = RandomString::generate_with_delimiter(Alphanumeric, b'\n', 10, false, 100);
/// assert_eq!(100, random_string.len());
/// ```
pub struct RandomString;
@ -108,7 +108,7 @@ impl RandomString {
/// use crate::common::random::{AlphanumericNewline, RandomString};
///
/// // generates a 100 byte string with 10 '\0' byte characters not ending with a '\0' byte
/// let string = RandomString::generate_with_delimiter(&AlphanumericNewline, 0, 10, false, 100);
/// let string = RandomString::generate_with_delimiter(AlphanumericNewline, 0, 10, false, 100);
/// assert_eq!(100, random_string.len());
/// assert_eq!(
/// 10,