Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/bin/coreutils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ Currently defined functions:
}
}

#[allow(clippy::cognitive_complexity)]
fn main() {
let utils = util_map();
let mut args = uucore::args_os();
Expand Down
1 change: 0 additions & 1 deletion src/uu/cp/src/cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,6 @@ impl Attributes {
}

impl Options {
#[allow(clippy::cognitive_complexity)]
fn from_matches(matches: &ArgMatches) -> CopyResult<Self> {
let not_implemented_opts = vec![
#[cfg(not(any(windows, unix)))]
Expand Down
4 changes: 1 addition & 3 deletions src/uu/csplit/src/csplit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ impl SplitWriter<'_> {
/// - if no line matched, an [`CsplitError::MatchNotFound`].
/// - if there are not enough lines to accommodate the offset, an
/// [`CsplitError::LineOutOfRange`].
#[allow(clippy::cognitive_complexity)]
fn do_to_match<I>(
&mut self,
pattern_as_str: &str,
Expand Down Expand Up @@ -723,7 +722,6 @@ mod tests {
use super::*;

#[test]
#[allow(clippy::cognitive_complexity)]
fn input_splitter() {
let input = vec![
Ok(String::from("aaa")),
Expand Down Expand Up @@ -796,7 +794,7 @@ mod tests {
}

#[test]
#[allow(clippy::cognitive_complexity)]
#[expect(clippy::cognitive_complexity)]
fn input_splitter_interrupt_rewind() {
let input = vec![
Ok(String::from("aaa")),
Expand Down
2 changes: 0 additions & 2 deletions src/uu/csplit/src/patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ mod tests {
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn up_to_match_pattern() {
let input = [
"/test1.*end$/",
Expand Down Expand Up @@ -268,7 +267,6 @@ mod tests {
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn skip_to_match_pattern() {
let input = [
"%test1.*end$%",
Expand Down
2 changes: 1 addition & 1 deletion src/uu/date/src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ fn parse_military_timezone_with_offset(s: &str) -> Option<(i32, DayDelta)> {
}

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

Expand Down
1 change: 0 additions & 1 deletion src/uu/dd/src/dd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,6 @@ fn finalize<T>(
}

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

Expand Down
1 change: 0 additions & 1 deletion src/uu/dd/src/numbers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ mod tests {
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn test_to_magnitude_and_suffix_not_powers_of_1024() {
assert_eq!(to_magnitude_and_suffix(1, SuffixType::Si), "1.0 B");
assert_eq!(to_magnitude_and_suffix(999, SuffixType::Si), "999 B");
Expand Down
2 changes: 0 additions & 2 deletions src/uu/dd/src/parseargs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ impl Parser {
}
}

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

#[allow(clippy::cognitive_complexity)]
fn parse_output_flags(&mut self, val: &str) -> Result<(), ParseError> {
let o = &mut self.oflag;
for f in val.split(',') {
Expand Down
1 change: 0 additions & 1 deletion src/uu/dd/src/parseargs/unit_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ fn test_status_level_none() {
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn test_all_top_level_args_no_leading_dashes() {
let args = [
"if=foo.file",
Expand Down
1 change: 0 additions & 1 deletion src/uu/df/src/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ mod tests {
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn test_to_magnitude_and_suffix_not_powers_of_1024() {
assert_eq!(to_magnitude_and_suffix(1, SuffixType::Si, true), "1.0B");
assert_eq!(to_magnitude_and_suffix(999, SuffixType::Si, true), "999B");
Expand Down
3 changes: 1 addition & 2 deletions src/uu/du/src/du.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ fn safe_du(
// Only used on non-Linux platforms
// Regular traversal using std::fs
// Used on non-Linux platforms and as fallback for symlinks on Linux
#[allow(clippy::cognitive_complexity)]
#[expect(clippy::cognitive_complexity)]
fn du_regular(
mut my_stat: Stat,
options: &TraversalOptions,
Expand Down Expand Up @@ -1005,7 +1005,6 @@ fn parse_size_format(matches: &ArgMatches) -> UResult<SizeFormat> {
}

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

Expand Down
1 change: 0 additions & 1 deletion src/uu/fmt/src/linebreak.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ struct LineBreak<'a> {
fresh: bool,
}

#[allow(clippy::cognitive_complexity)]
fn find_kp_breakpoints<'a, T: Clone + Iterator<Item = &'a WordInfo<'a>>>(
iter: T,
args: &BreakArgs<'a>,
Expand Down
1 change: 0 additions & 1 deletion src/uu/fmt/src/parasplit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,6 @@ impl ParagraphStream<'_> {
impl Iterator for ParagraphStream<'_> {
type Item = Result<Paragraph, Vec<u8>>;

#[allow(clippy::cognitive_complexity)]
fn next(&mut self) -> Option<Result<Paragraph, Vec<u8>>> {
// return a NoFormatLine in an Err; it should immediately be output
let noformat = match self.lines.peek()? {
Expand Down
1 change: 0 additions & 1 deletion src/uu/fold/src/fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,6 @@ fn process_pending_chunk<W: Write>(
///
/// If `spaces` is `true`, attempt to break lines at whitespace boundaries.
#[allow(unused_assignments)]
#[allow(clippy::cognitive_complexity)]
fn fold_file<T: Read, W: Write>(
mut file: BufReader<T>,
spaces: bool,
Expand Down
2 changes: 0 additions & 2 deletions src/uu/head/src/head.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ fn head_file(input: &mut File, options: &HeadOptions) -> io::Result<u64> {
}
}

#[allow(clippy::cognitive_complexity)]
fn uu_head(options: &HeadOptions) -> UResult<()> {
let mut first = true;
for file in &options.files {
Expand Down Expand Up @@ -531,7 +530,6 @@ mod tests {
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn all_args_test() {
assert!(options("--silent").unwrap().quiet);
assert!(options("--quiet").unwrap().quiet);
Expand Down
1 change: 0 additions & 1 deletion src/uu/head/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ mod tests {
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn test_parse_numbers_obsolete() {
assert_eq!(obsolete("-5"), obsolete_result(&["-n", "5"]));
assert_eq!(obsolete("-100"), obsolete_result(&["-n", "100"]));
Expand Down
2 changes: 1 addition & 1 deletion src/uu/head/src/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ mod tests {
}

#[test]
#[allow(clippy::cognitive_complexity)]
#[expect(clippy::cognitive_complexity)]
fn test_take_all_lines_buffer() {
// 3 lines with new-lines and one partial line.
let input_buffer = "a\nb\nc\ndef";
Expand Down
1 change: 0 additions & 1 deletion src/uu/id/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ struct State {
}

#[uucore::main(no_signals)]
#[allow(clippy::cognitive_complexity)]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let matches = uucore::clap_localization::handle_clap_result(uu_app(), args)?;
let mut lock = io::stdout().lock();
Expand Down
2 changes: 1 addition & 1 deletion src/uu/install/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ fn is_potential_directory_path(path: &Path) -> bool {
///
/// Returns a Result type with the Err variant containing the error message.
///
#[allow(clippy::cognitive_complexity)]
#[expect(clippy::cognitive_complexity)]
fn standard(mut paths: Vec<OsString>, b: &Behavior) -> UResult<()> {
// first check that paths contains at least one element
if paths.is_empty() {
Expand Down
2 changes: 0 additions & 2 deletions src/uu/ln/src/ln.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ fn exec(files: &[PathBuf], settings: &Settings) -> UResult<()> {
link(&files[0], &files[1], settings)
}

#[allow(clippy::cognitive_complexity)]
fn link_files_in_dir(files: &[PathBuf], target_dir: &Path, settings: &Settings) -> UResult<()> {
if !target_dir.is_dir() {
return Err(LnError::TargetIsNotADirectory(target_dir.to_owned()).into());
Expand Down Expand Up @@ -386,7 +385,6 @@ fn relative_path<'a>(src: &'a Path, dst: &Path) -> Cow<'a, Path> {
src.into()
}

#[allow(clippy::cognitive_complexity)]
fn link(src: &Path, dst: &Path, settings: &Settings) -> UResult<()> {
let mut backup_path = None;
let source: Cow<'_, Path> = if settings.relative {
Expand Down
2 changes: 1 addition & 1 deletion src/uu/ls/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ fn parse_width(width_match: Option<&String>) -> Result<u16, LsError> {
}

impl Config {
#[allow(clippy::cognitive_complexity)]
#[expect(clippy::cognitive_complexity)]
pub fn from(options: &clap::ArgMatches) -> UResult<Self> {
let context = options.get_flag(options::CONTEXT);
let (mut format, opt) = extract_format(options);
Expand Down
3 changes: 0 additions & 3 deletions src/uu/ls/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ fn pad_left(string: &str, count: usize) -> String {
format!("{string:>count$}")
}

#[allow(clippy::cognitive_complexity)]
pub fn display_items(
items: &[PathData],
config: &Config,
Expand Down Expand Up @@ -674,7 +673,6 @@ pub fn display_size(size: u64, config: &Config) -> String {
///
/// Note that non-unicode sequences in symlink targets are dealt with using
/// [`std::path::Path::to_string_lossy`].
#[allow(clippy::cognitive_complexity)]
fn display_item_name(
path: &PathData,
config: &Config,
Expand Down Expand Up @@ -870,7 +868,6 @@ fn display_item_name(
/// ```
/// that decide the maximum possible character count of each field.
#[allow(clippy::write_literal)]
#[allow(clippy::cognitive_complexity)]
fn display_item_long(
item: &PathData,
padding: &PaddingCollection,
Expand Down
1 change: 0 additions & 1 deletion src/uu/mv/src/mv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,6 @@ pub fn mv(files: &[OsString], opts: &Options) -> UResult<()> {
}
}

#[allow(clippy::cognitive_complexity)]
fn move_files_into_dir(files: &[PathBuf], target_dir: &Path, options: &Options) -> UResult<()> {
// remember the moved destinations for further usage
let mut moved_destinations: FxHashSet<PathBuf> =
Expand Down
1 change: 0 additions & 1 deletion src/uu/nl/src/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use uucore::translate;

// parse_options loads the options into the settings, returning an array of
// error messages.
#[allow(clippy::cognitive_complexity)]
pub fn parse_options(settings: &mut crate::Settings, opts: &clap::ArgMatches) -> Vec<String> {
// This vector holds error messages encountered.
let mut errs: Vec<String> = vec![];
Expand Down
1 change: 0 additions & 1 deletion src/uu/numfmt/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,6 @@ mod tests {
use super::*;

#[test]
#[allow(clippy::cognitive_complexity)]
fn test_round_with_precision() {
let rm = RoundMethod::FromZero;
assert_eq!(1.0, round_with_precision(0.12345, rm, 0));
Expand Down
3 changes: 1 addition & 2 deletions src/uu/numfmt/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl FromStr for FormatOptions {
// An optional zero (%010f) will zero pad the number.
// An optional negative value (%-10f) will left align.
// An optional precision (%.1f) determines the precision of the number.
#[allow(clippy::cognitive_complexity)]
#[expect(clippy::cognitive_complexity)]
fn from_str(s: &str) -> Result<Self, Self::Err> {
let mut iter = s.chars().peekable();
let mut options = Self::default();
Expand Down Expand Up @@ -274,7 +274,6 @@ mod tests {
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn test_parse_format_with_invalid_formats() {
assert!("".parse::<FormatOptions>().is_err());
assert!("hello".parse::<FormatOptions>().is_err());
Expand Down
1 change: 0 additions & 1 deletion src/uu/od/src/input_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ mod tests {

#[test]
#[allow(clippy::float_cmp)]
#[allow(clippy::cognitive_complexity)]
fn smoke_test() {
let data = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xff, 0xff];
let mut input = PeekReader::new(Cursor::new(&data));
Expand Down
1 change: 0 additions & 1 deletion src/uu/od/src/output_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ fn assert_alignment(
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn test_calculate_alignment() {
// For this example `byte_size_block` is 8 and 'print_width_block' is 23:
// 1777777777777777777777 1777777777777777777777
Expand Down
1 change: 0 additions & 1 deletion src/uu/od/src/parse_formats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ fn od_argument_with_option(ch: char) -> bool {
/// arguments with parameters like -w16 can only appear at the end: -fvoxw16
/// parameters of -t/--format specify 1 or more formats.
/// if -- appears on the command line, parsing should stop.
#[allow(clippy::cognitive_complexity)]
pub fn parse_format_flags(args: &[String]) -> Result<Vec<ParsedFormatterItemInfo>, String> {
let mut formats = Vec::new();

Expand Down
2 changes: 0 additions & 2 deletions src/uu/od/src/parse_inputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ mod tests {
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn test_parse_inputs_with_offset() {
// offset is found without filename, so stdin will be used.
assert_eq!(
Expand Down Expand Up @@ -414,7 +413,6 @@ mod tests {
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn test_parse_offset_operand() {
assert_eq!(8, parse_offset_operand_str("10").unwrap()); // default octal
assert_eq!(0, parse_offset_operand_str("0").unwrap());
Expand Down
1 change: 0 additions & 1 deletion src/uu/od/src/parse_nrofbytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ pub fn parse_number_of_bytes(s: &str) -> Result<u64, ParseSizeError> {
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn test_parse_number_of_bytes() {
// octal input
assert_eq!(8, parse_number_of_bytes("010").unwrap());
Expand Down
1 change: 0 additions & 1 deletion src/uu/od/src/peek_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ mod tests {
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn test_peek_read_with_smaller_buffer() {
let mut sut = PeekReader::new(Cursor::new(&b"abcdefghij"[..]));

Expand Down
2 changes: 0 additions & 2 deletions src/uu/od/src/prn_char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ pub fn format_ascii_dump(bytes: &[u8]) -> String {
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn test_format_item_a() {
assert_eq!(" nul", format_item_a(0x00));
assert_eq!(" soh", format_item_a(0x01));
Expand All @@ -94,7 +93,6 @@ fn test_format_item_a() {
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn test_format_item_c() {
assert_eq!(" \\0", format_item_c(&[0x00]));
assert_eq!(" 001", format_item_c(&[0x01]));
Expand Down
4 changes: 1 addition & 3 deletions src/uu/od/src/prn_float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ fn format_long_double(f: f64) -> String {

#[test]
#[allow(clippy::excessive_precision)]
#[allow(clippy::cognitive_complexity)]
#[expect(clippy::cognitive_complexity)]
fn test_format_f32() {
assert_eq!(format_f32(1.0), " 1.0000000");
assert_eq!(format_f32(9.999_999_0), " 9.9999990");
Expand Down Expand Up @@ -316,7 +316,6 @@ fn test_format_f32() {
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn test_format_f64() {
assert_eq!(format_f64(1.0), " 1.0000000000000000");
assert_eq!(format_f64(10.0), " 10.000000000000000");
Expand Down Expand Up @@ -349,7 +348,6 @@ fn test_format_f64() {
}

#[test]
#[allow(clippy::cognitive_complexity)]
fn test_format_f16() {
assert_eq!(format_f16(f16::from_bits(0x8400u16)), " -6.1035156e-5");
assert_eq!(format_f16(f16::from_bits(0x8401u16)), " -6.1094761e-5");
Expand Down
Loading
Loading