mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
lint: fix clippy::suspicious_open_options
of project.
This commit is contained in:
parent
ef8c379370
commit
d21dc125d0
4 changed files with 5 additions and 2 deletions
|
@ -1,2 +1,2 @@
|
||||||
msrv = "1.70.0"
|
msrv = "1.70.0"
|
||||||
cognitive-complexity-threshold = 10
|
cognitive-complexity-threshold = 24
|
||||||
|
|
|
@ -247,11 +247,11 @@ pub struct Output {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Output {
|
impl Output {
|
||||||
#[allow(clippy::suspicious_open_options)]
|
|
||||||
fn new(name: Option<&str>) -> UResult<Self> {
|
fn new(name: Option<&str>) -> UResult<Self> {
|
||||||
let file = if let Some(name) = name {
|
let file = if let Some(name) = name {
|
||||||
// This is different from `File::create()` because we don't truncate the output yet.
|
// This is different from `File::create()` because we don't truncate the output yet.
|
||||||
// This allows using the output file as an input file.
|
// This allows using the output file as an input file.
|
||||||
|
#[allow(clippy::suspicious_open_options)]
|
||||||
let file = OpenOptions::new()
|
let file = OpenOptions::new()
|
||||||
.write(true)
|
.write(true)
|
||||||
.create(true)
|
.create(true)
|
||||||
|
|
|
@ -445,6 +445,7 @@ macro_rules! compare_with_gnu {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[allow(clippy::cognitive_complexity)] // Ignore clippy lint of too long function sign
|
||||||
fn test_env_with_gnu_reference_parsing_errors() {
|
fn test_env_with_gnu_reference_parsing_errors() {
|
||||||
let ts = TestScenario::new(util_name!());
|
let ts = TestScenario::new(util_name!());
|
||||||
|
|
||||||
|
|
|
@ -208,6 +208,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[allow(clippy::cognitive_complexity)] // Ignore clippy lint of too long function sign
|
||||||
fn test_random_string_generate_with_delimiter_should_end_with_delimiter() {
|
fn test_random_string_generate_with_delimiter_should_end_with_delimiter() {
|
||||||
let random_string = RandomString::generate_with_delimiter(Alphanumeric, 0, 1, true, 1);
|
let random_string = RandomString::generate_with_delimiter(Alphanumeric, 0, 1, true, 1);
|
||||||
assert_eq!(1, random_string.len());
|
assert_eq!(1, random_string.len());
|
||||||
|
@ -251,6 +252,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[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() {
|
fn test_random_string_generate_with_delimiter_should_not_end_with_delimiter() {
|
||||||
let random_string = RandomString::generate_with_delimiter(Alphanumeric, 0, 0, false, 1);
|
let random_string = RandomString::generate_with_delimiter(Alphanumeric, 0, 0, false, 1);
|
||||||
assert_eq!(1, random_string.len());
|
assert_eq!(1, random_string.len());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue