1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

Merge pull request #7329 from cakebaker/clippy_fix_warnings_rust_1_85

clippy: fix/disable warnings introduced with Rust `1.85`
This commit is contained in:
Sylvestre Ledru 2025-02-21 11:22:16 +01:00 committed by GitHub
commit d065e172f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 15 additions and 1 deletions

View file

@ -508,6 +508,8 @@ impl StatPrinter {
grand_total += size; grand_total += size;
} }
// TODO fix requires an MSRV of 1.82
#[allow(clippy::unnecessary_map_or)]
if !self if !self
.threshold .threshold
.is_some_and(|threshold| threshold.should_exclude(size)) .is_some_and(|threshold| threshold.should_exclude(size))

View file

@ -869,6 +869,8 @@ fn read_stream_and_create_pages(
let last_page = options.end_page; let last_page = options.end_page;
let lines_needed_per_page = lines_to_read_for_page(options); 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( Box::new(
lines lines
.flat_map(split_lines_if_form_feed) .flat_map(split_lines_if_form_feed)

View file

@ -605,6 +605,8 @@ impl<'a> Line<'a> {
)?; )?;
} }
} }
// TODO fix requires an MSRV of 1.82
#[allow(clippy::unnecessary_map_or)]
if settings.mode != SortMode::Random if settings.mode != SortMode::Random
&& !settings.stable && !settings.stable
&& !settings.unique && !settings.unique

View file

@ -497,6 +497,8 @@ pub fn uu_app() -> Command {
} }
impl TermiosFlag for ControlFlags { 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 { fn is_in(&self, termios: &Termios, group: Option<Self>) -> bool {
termios.control_flags.contains(*self) termios.control_flags.contains(*self)
&& group.map_or(true, |g| !termios.control_flags.intersects(g - *self)) && group.map_or(true, |g| !termios.control_flags.intersects(g - *self))
@ -508,6 +510,8 @@ impl TermiosFlag for ControlFlags {
} }
impl TermiosFlag for InputFlags { 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 { fn is_in(&self, termios: &Termios, group: Option<Self>) -> bool {
termios.input_flags.contains(*self) termios.input_flags.contains(*self)
&& group.map_or(true, |g| !termios.input_flags.intersects(g - *self)) && group.map_or(true, |g| !termios.input_flags.intersects(g - *self))
@ -519,6 +523,8 @@ impl TermiosFlag for InputFlags {
} }
impl TermiosFlag for OutputFlags { 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 { fn is_in(&self, termios: &Termios, group: Option<Self>) -> bool {
termios.output_flags.contains(*self) termios.output_flags.contains(*self)
&& group.map_or(true, |g| !termios.output_flags.intersects(g - *self)) && group.map_or(true, |g| !termios.output_flags.intersects(g - *self))
@ -530,6 +536,8 @@ impl TermiosFlag for OutputFlags {
} }
impl TermiosFlag for LocalFlags { 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 { fn is_in(&self, termios: &Termios, group: Option<Self>) -> bool {
termios.local_flags.contains(*self) termios.local_flags.contains(*self)
&& group.map_or(true, |g| !termios.local_flags.intersects(g - *self)) && group.map_or(true, |g| !termios.local_flags.intersects(g - *self))

View file

@ -814,7 +814,7 @@ impl FsMeta for StatFs {
fn fsid(&self) -> u64 { fn fsid(&self) -> u64 {
let f_fsid: &[u32; 2] = let f_fsid: &[u32; 2] =
unsafe { &*(&self.f_fsid as *const nix::sys::statfs::fsid_t as *const [u32; 2]) }; unsafe { &*(&self.f_fsid as *const nix::sys::statfs::fsid_t as *const [u32; 2]) };
(u64::from(f_fsid[0])) << 32 | u64::from(f_fsid[1]) ((u64::from(f_fsid[0])) << 32) | u64::from(f_fsid[1])
} }
#[cfg(not(any( #[cfg(not(any(
target_vendor = "apple", target_vendor = "apple",