stdlib: remove is_none_or backport

The backport is no longer necessary with our new MSRV.

Part of #11964
This commit is contained in:
Daniel Rainer
2025-10-17 00:45:19 +02:00
committed by Johannes Altmanninger
parent 15fd99072b
commit 448471bd50
9 changed files with 0 additions and 33 deletions

View File

@@ -23,8 +23,6 @@
use crate::env::env_init;
use crate::env::environment::Environment;
use crate::expand::INTERNAL_SEPARATOR;
#[allow(unused_imports)]
use crate::future::IsSomeAnd;
use crate::future_feature_flags;
use crate::global_safety::RelaxedAtomicBool;
use crate::highlight::{HighlightRole, HighlightSpec, colorize, highlight_shell};

View File

@@ -11,8 +11,6 @@
use libc::{STDIN_FILENO, VEOF, VINTR};
#[allow(unused_imports)]
use crate::future::IsSomeAnd;
use crate::{
builtins::shared::BUILTIN_ERR_UNKNOWN,
common::{PROGRAM_NAME, bytes2wcstring, shell_modes},

View File

@@ -1,7 +1,5 @@
use std::ops::Range;
#[allow(unused_imports)]
use crate::future::IsSomeAnd;
use crate::highlight::HighlightSpec;
use crate::wchar::prelude::*;

View File

@@ -1,17 +0,0 @@
//! stdlib backports
// TODO(MSRV): is_none_or was added in rust 1.82
pub trait IsSomeAnd {
type Type;
#[allow(clippy::wrong_self_convention)]
fn is_none_or(self, s: impl FnOnce(Self::Type) -> bool) -> bool;
}
impl<T> IsSomeAnd for Option<T> {
type Type = T;
fn is_none_or(self, f: impl FnOnce(T) -> bool) -> bool {
match self {
Some(v) => f(v),
None => true,
}
}
}

View File

@@ -2,9 +2,6 @@
use crate::env::Environment;
use crate::event;
use crate::flog::FLOG;
// Polyfill for Option::is_none_or(), stabilized in 1.82.0
#[allow(unused_imports)]
use crate::future::IsSomeAnd;
use crate::global_safety::RelaxedAtomicBool;
use crate::input_common::{
CharEvent, CharInputStyle, ImplicitEvent, InputData, InputEventQueuer, KeyMatchQuality,

View File

@@ -53,7 +53,6 @@
pub mod fork_exec;
pub mod fs;
pub mod function;
pub mod future;
pub mod future_feature_flags;
pub mod global_safety;
pub mod highlight;

View File

@@ -9,8 +9,6 @@
};
use crate::complete::Completion;
use crate::editable_line::EditableLine;
#[allow(unused_imports)]
use crate::future::IsSomeAnd;
use crate::highlight::{HighlightRole, HighlightSpec, highlight_shell};
use crate::operation_context::OperationContext;
use crate::screen::{CharOffset, Line, ScreenData, wcswidth_rendered, wcwidth_rendered};

View File

@@ -75,8 +75,6 @@
use crate::fd_readable_set::poll_fd_readable;
use crate::fds::{AutoCloseFd, make_fd_blocking, wopen_cloexec};
use crate::flog::{FLOG, FLOGF};
#[allow(unused_imports)]
use crate::future::IsSomeAnd;
use crate::future_feature_flags;
use crate::future_feature_flags::FeatureFlag;
use crate::global_safety::RelaxedAtomicBool;

View File

@@ -28,8 +28,6 @@
use crate::env::Environment;
use crate::fallback::fish_wcwidth;
use crate::flog::FLOGF;
#[allow(unused_imports)]
use crate::future::IsSomeAnd;
use crate::global_safety::RelaxedAtomicBool;
use crate::highlight::{HighlightColorResolver, HighlightSpec};
use crate::terminal::TerminalCommand::{