mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-15 03:26:18 +00:00
Merge pull request #6102 from Krysztal112233/main
lint: fix lints of new Rust version
This commit is contained in:
commit
88ff42e840
12 changed files with 29 additions and 20 deletions
|
@ -397,7 +397,7 @@ fn test_base64_multiple_files() {
|
|||
.arg("alice_in_wonderland.txt")
|
||||
.succeeds()
|
||||
.no_stderr()
|
||||
.stdout_is_fixture_bytes(format!("base64/md5_multiple_files.expected"));
|
||||
.stdout_is_fixture_bytes("base64/md5_multiple_files.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -3306,7 +3306,7 @@ fn test_symbolic_link_file() {
|
|||
#[test]
|
||||
fn test_src_base_dot() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let at = ts.fixtures.clone();
|
||||
let at = &ts.fixtures;
|
||||
at.mkdir("x");
|
||||
at.mkdir("y");
|
||||
ts.ucmd()
|
||||
|
|
|
@ -1641,7 +1641,7 @@ fn test_seek_past_dev() {
|
|||
fn test_reading_partial_blocks_from_fifo() {
|
||||
// Create the FIFO.
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let at = ts.fixtures.clone();
|
||||
let at = &ts.fixtures;
|
||||
at.mkfifo("fifo");
|
||||
let fifoname = at.plus_as_string("fifo");
|
||||
|
||||
|
@ -1682,7 +1682,7 @@ fn test_reading_partial_blocks_from_fifo() {
|
|||
fn test_reading_partial_blocks_from_fifo_unbuffered() {
|
||||
// Create the FIFO.
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let at = ts.fixtures.clone();
|
||||
let at = ts.fixtures;
|
||||
at.mkfifo("fifo");
|
||||
let fifoname = at.plus_as_string("fifo");
|
||||
|
||||
|
|
|
@ -445,6 +445,7 @@ macro_rules! compare_with_gnu {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::cognitive_complexity)] // Ignore clippy lint of too long function sign
|
||||
fn test_env_with_gnu_reference_parsing_errors() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
// spell-checker:ignore (formats) cymdhm cymdhms mdhm mdhms ymdhm ymdhms datetime mktime
|
||||
|
||||
use crate::common::util::{AtPath, TestScenario};
|
||||
use filetime::{set_symlink_file_times, FileTime};
|
||||
#[cfg(not(target_os = "freebsd"))]
|
||||
use filetime::set_symlink_file_times;
|
||||
use filetime::FileTime;
|
||||
use std::fs::remove_file;
|
||||
use std::path::PathBuf;
|
||||
|
||||
|
|
|
@ -208,6 +208,7 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::cognitive_complexity)] // Ignore clippy lint of too long function sign
|
||||
fn test_random_string_generate_with_delimiter_should_end_with_delimiter() {
|
||||
let random_string = RandomString::generate_with_delimiter(Alphanumeric, 0, 1, true, 1);
|
||||
assert_eq!(1, random_string.len());
|
||||
|
@ -251,6 +252,7 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::cognitive_complexity)] // Ignore clippy lint of too long function sign
|
||||
fn test_random_string_generate_with_delimiter_should_not_end_with_delimiter() {
|
||||
let random_string = RandomString::generate_with_delimiter(Alphanumeric, 0, 0, false, 1);
|
||||
assert_eq!(1, random_string.len());
|
||||
|
|
|
@ -33,7 +33,7 @@ use std::os::unix::process::ExitStatusExt;
|
|||
#[cfg(windows)]
|
||||
use std::os::windows::fs::{symlink_dir, symlink_file};
|
||||
#[cfg(windows)]
|
||||
use std::path::MAIN_SEPARATOR;
|
||||
use std::path::MAIN_SEPARATOR_STR;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::{Child, Command, ExitStatus, Output, Stdio};
|
||||
use std::rc::Rc;
|
||||
|
@ -1016,7 +1016,7 @@ impl AtPath {
|
|||
|
||||
pub fn relative_symlink_file(&self, original: &str, link: &str) {
|
||||
#[cfg(windows)]
|
||||
let original = original.replace('/', &MAIN_SEPARATOR.to_string());
|
||||
let original = original.replace('/', MAIN_SEPARATOR_STR);
|
||||
log_info(
|
||||
"symlink",
|
||||
format!("{},{}", &original, &self.plus_as_string(link)),
|
||||
|
@ -1038,7 +1038,7 @@ impl AtPath {
|
|||
|
||||
pub fn relative_symlink_dir(&self, original: &str, link: &str) {
|
||||
#[cfg(windows)]
|
||||
let original = original.replace('/', &MAIN_SEPARATOR.to_string());
|
||||
let original = original.replace('/', MAIN_SEPARATOR_STR);
|
||||
log_info(
|
||||
"symlink",
|
||||
format!("{},{}", &original, &self.plus_as_string(link)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue