Skip to content
Merged
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
4 changes: 1 addition & 3 deletions src/uu/du/src/du.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,14 +508,12 @@ impl StatPrinter {
grand_total += size;
}

// TODO fix requires an MSRV of 1.82
#[allow(clippy::unnecessary_map_or)]
if !self
.threshold
.is_some_and(|threshold| threshold.should_exclude(size))
&& self
.max_depth
.map_or(true, |max_depth| stat_info.depth <= max_depth)
.is_none_or(|max_depth| stat_info.depth <= max_depth)
&& (!self.summarize || stat_info.depth == 0)
{
self.print_stat(&stat_info.stat, size)?;
Expand Down
4 changes: 1 addition & 3 deletions src/uu/pr/src/pr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -869,8 +869,6 @@ fn read_stream_and_create_pages(
let last_page = options.end_page;
let lines_needed_per_page = lines_to_read_for_page(options);

// TODO fix requires an MSRV of 1.82
#[allow(clippy::unnecessary_map_or)]
Box::new(
lines
.flat_map(split_lines_if_form_feed)
Expand Down Expand Up @@ -919,7 +917,7 @@ fn read_stream_and_create_pages(
let current_page = x + 1;

current_page >= start_page
&& last_page.map_or(true, |last_page| current_page <= last_page)
&& last_page.is_none_or(|last_page| current_page <= last_page)
}),
)
}
Expand Down
5 changes: 2 additions & 3 deletions src/uu/sort/src/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,7 @@ impl<'a> Line<'a> {
)?;
}
}
// TODO fix requires an MSRV of 1.82
#[allow(clippy::unnecessary_map_or)]

if settings.mode != SortMode::Random
&& !settings.stable
&& !settings.unique
Expand All @@ -618,7 +617,7 @@ impl<'a> Line<'a> {
|| settings
.selectors
.last()
.map_or(true, |selector| selector != &FieldSelector::default()))
.is_none_or(|selector| selector != &FieldSelector::default()))
{
// A last resort comparator is in use, underline the whole line.
if self.line.is_empty() {
Expand Down
16 changes: 4 additions & 12 deletions src/uu/stty/src/stty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,11 +497,9 @@ pub fn uu_app() -> Command {
}

impl TermiosFlag for ControlFlags {
// TODO fix requires an MSRV of 1.82
#[allow(clippy::unnecessary_map_or)]
fn is_in(&self, termios: &Termios, group: Option<Self>) -> bool {
termios.control_flags.contains(*self)
&& group.map_or(true, |g| !termios.control_flags.intersects(g - *self))
&& group.is_none_or(|g| !termios.control_flags.intersects(g - *self))
}

fn apply(&self, termios: &mut Termios, val: bool) {
Expand All @@ -510,11 +508,9 @@ impl TermiosFlag for ControlFlags {
}

impl TermiosFlag for InputFlags {
// TODO fix requires an MSRV of 1.82
#[allow(clippy::unnecessary_map_or)]
fn is_in(&self, termios: &Termios, group: Option<Self>) -> bool {
termios.input_flags.contains(*self)
&& group.map_or(true, |g| !termios.input_flags.intersects(g - *self))
&& group.is_none_or(|g| !termios.input_flags.intersects(g - *self))
}

fn apply(&self, termios: &mut Termios, val: bool) {
Expand All @@ -523,11 +519,9 @@ impl TermiosFlag for InputFlags {
}

impl TermiosFlag for OutputFlags {
// TODO fix requires an MSRV of 1.82
#[allow(clippy::unnecessary_map_or)]
fn is_in(&self, termios: &Termios, group: Option<Self>) -> bool {
termios.output_flags.contains(*self)
&& group.map_or(true, |g| !termios.output_flags.intersects(g - *self))
&& group.is_none_or(|g| !termios.output_flags.intersects(g - *self))
}

fn apply(&self, termios: &mut Termios, val: bool) {
Expand All @@ -536,11 +530,9 @@ impl TermiosFlag for OutputFlags {
}

impl TermiosFlag for LocalFlags {
// TODO fix requires an MSRV of 1.82
#[allow(clippy::unnecessary_map_or)]
fn is_in(&self, termios: &Termios, group: Option<Self>) -> bool {
termios.local_flags.contains(*self)
&& group.map_or(true, |g| !termios.local_flags.intersects(g - *self))
&& group.is_none_or(|g| !termios.local_flags.intersects(g - *self))
}

fn apply(&self, termios: &mut Termios, val: bool) {
Expand Down
Loading