mirror of
https://github.com/uutils/coreutils
synced 2024-11-10 07:04:16 +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"
|
||||
cognitive-complexity-threshold = 10
|
||||
cognitive-complexity-threshold = 24
|
||||
|
|
|
@ -247,11 +247,11 @@ pub struct Output {
|
|||
}
|
||||
|
||||
impl Output {
|
||||
#[allow(clippy::suspicious_open_options)]
|
||||
fn new(name: Option<&str>) -> UResult<Self> {
|
||||
let file = if let Some(name) = name {
|
||||
// This is different from `File::create()` because we don't truncate the output yet.
|
||||
// This allows using the output file as an input file.
|
||||
#[allow(clippy::suspicious_open_options)]
|
||||
let file = OpenOptions::new()
|
||||
.write(true)
|
||||
.create(true)
|
||||
|
|
|
@ -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!());
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue