Skip to content

Commit 74496ba

Browse files
committed
clippy: remove unfullfiled cognitive_complexity allowance
1 parent 444e383 commit 74496ba

55 files changed

Lines changed: 13 additions & 81 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/bin/coreutils.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ Currently defined functions:
4949
}
5050
}
5151

52-
#[allow(clippy::cognitive_complexity)]
5352
fn main() {
5453
let utils = util_map();
5554
let mut args = uucore::args_os();

src/uu/cp/src/cp.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,6 @@ impl Attributes {
10121012
}
10131013

10141014
impl Options {
1015-
#[allow(clippy::cognitive_complexity)]
10161015
fn from_matches(matches: &ArgMatches) -> CopyResult<Self> {
10171016
let not_implemented_opts = vec![
10181017
#[cfg(not(any(windows, unix)))]

src/uu/csplit/src/csplit.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ impl SplitWriter<'_> {
406406
/// - if no line matched, an [`CsplitError::MatchNotFound`].
407407
/// - if there are not enough lines to accommodate the offset, an
408408
/// [`CsplitError::LineOutOfRange`].
409-
#[allow(clippy::cognitive_complexity)]
410409
fn do_to_match<I>(
411410
&mut self,
412411
pattern_as_str: &str,
@@ -723,7 +722,6 @@ mod tests {
723722
use super::*;
724723

725724
#[test]
726-
#[allow(clippy::cognitive_complexity)]
727725
fn input_splitter() {
728726
let input = vec![
729727
Ok(String::from("aaa")),
@@ -796,7 +794,7 @@ mod tests {
796794
}
797795

798796
#[test]
799-
#[allow(clippy::cognitive_complexity)]
797+
#[expect(clippy::cognitive_complexity)]
800798
fn input_splitter_interrupt_rewind() {
801799
let input = vec![
802800
Ok(String::from("aaa")),

src/uu/csplit/src/patterns.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ mod tests {
209209
}
210210

211211
#[test]
212-
#[allow(clippy::cognitive_complexity)]
213212
fn up_to_match_pattern() {
214213
let input = [
215214
"/test1.*end$/",
@@ -268,7 +267,6 @@ mod tests {
268267
}
269268

270269
#[test]
271-
#[allow(clippy::cognitive_complexity)]
272270
fn skip_to_match_pattern() {
273271
let input = [
274272
"%test1.*end$%",

src/uu/date/src/date.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ fn parse_military_timezone_with_offset(s: &str) -> Option<(i32, DayDelta)> {
281281
}
282282

283283
#[uucore::main]
284-
#[allow(clippy::cognitive_complexity)]
284+
#[expect(clippy::cognitive_complexity)]
285285
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
286286
let matches = uucore::clap_localization::handle_clap_result(uu_app(), args)?;
287287

src/uu/dd/src/dd.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,6 @@ fn finalize<T>(
13221322
}
13231323

13241324
#[cfg(any(target_os = "linux", target_os = "android"))]
1325-
#[allow(clippy::cognitive_complexity)]
13261325
fn make_linux_oflags(oflags: &OFlags) -> Option<libc::c_int> {
13271326
let mut flag = 0;
13281327

src/uu/dd/src/numbers.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ mod tests {
8989
}
9090

9191
#[test]
92-
#[allow(clippy::cognitive_complexity)]
9392
fn test_to_magnitude_and_suffix_not_powers_of_1024() {
9493
assert_eq!(to_magnitude_and_suffix(1, SuffixType::Si), "1.0 B");
9594
assert_eq!(to_magnitude_and_suffix(999, SuffixType::Si), "999 B");

src/uu/dd/src/parseargs.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ impl Parser {
338338
}
339339
}
340340

341-
#[allow(clippy::cognitive_complexity)]
342341
fn parse_input_flags(&mut self, val: &str) -> Result<(), ParseError> {
343342
let i = &mut self.iflag;
344343
for f in val.split(',') {
@@ -370,7 +369,6 @@ impl Parser {
370369
Ok(())
371370
}
372371

373-
#[allow(clippy::cognitive_complexity)]
374372
fn parse_output_flags(&mut self, val: &str) -> Result<(), ParseError> {
375373
let o = &mut self.oflag;
376374
for f in val.split(',') {

src/uu/dd/src/parseargs/unit_tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ fn test_status_level_none() {
8888
}
8989

9090
#[test]
91-
#[allow(clippy::cognitive_complexity)]
9291
fn test_all_top_level_args_no_leading_dashes() {
9392
let args = [
9493
"if=foo.file",

src/uu/df/src/blocks.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ mod tests {
277277
}
278278

279279
#[test]
280-
#[allow(clippy::cognitive_complexity)]
281280
fn test_to_magnitude_and_suffix_not_powers_of_1024() {
282281
assert_eq!(to_magnitude_and_suffix(1, SuffixType::Si, true), "1.0B");
283282
assert_eq!(to_magnitude_and_suffix(999, SuffixType::Si, true), "999B");

0 commit comments

Comments
 (0)