Skip to content

wc.rs: Refactor to remove #[allow(clippy::cognitive_complexity)] #5882

@sylvestre

Description

@sylvestre

https://github.com/uutils/coreutils/blob/main/src/uu/wc/src/wc.rs#L568

A potential way to do it:

    while let Some(chunk) = reader.next_strict() {
        match chunk {
            Ok(text) => process_chunk(&mut total, &text),
            Err(error) => return handle_error(error, &total),
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions