diff --git a/atorsl/src/demangler.rs b/atorsl/src/demangler.rs index 335aa96..462200f 100644 --- a/atorsl/src/demangler.rs +++ b/atorsl/src/demangler.rs @@ -1,4 +1,4 @@ -use crate::{Error, IsOkAnd}; +use crate::Error; use std::{borrow::Cow, convert::identity}; use swift::Scope; diff --git a/atorsl/src/lib.rs b/atorsl/src/lib.rs index 85f6a7c..64cfbb9 100644 --- a/atorsl/src/lib.rs +++ b/atorsl/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(unstable_name_collisions)] - pub mod data; pub mod demangler; pub mod ext; @@ -8,9 +6,6 @@ pub mod symbolicator; pub use data::Error; pub use symbolicator::{atos_dwarf, atos_map}; -pub(crate) mod prelude; -pub(crate) use prelude::*; - /// Loads a binary image object as DWARF. #[macro_export] macro_rules! load_dwarf { diff --git a/atorsl/src/prelude.rs b/atorsl/src/prelude.rs deleted file mode 100644 index 3d32397..0000000 --- a/atorsl/src/prelude.rs +++ /dev/null @@ -1,49 +0,0 @@ -// https://github.com/rust-lang/rust/issues/93050 -#![allow(clippy::wrong_self_convention)] - -pub(crate) trait IsSomeAnd { - #[must_use] - fn is_some_and(self, f: impl FnOnce(T) -> bool) -> bool; -} - -impl IsSomeAnd for Option { - /// Returns `true` if the option is a [`Some`] and the value inside of it matches a predicate. - #[must_use] - #[inline] - fn is_some_and(self, f: impl FnOnce(T) -> bool) -> bool { - match self { - None => false, - Some(x) => f(x), - } - } -} - -pub(crate) trait IsOkAnd { - #[must_use] - fn is_ok_and(self, f: impl FnOnce(T) -> bool) -> bool; - - #[must_use] - fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool; -} - -impl IsOkAnd for Result { - /// Returns `true` if the result is [`Ok`] and the value inside of it matches a predicate. - #[must_use] - #[inline] - fn is_ok_and(self, f: impl FnOnce(T) -> bool) -> bool { - match self { - Err(_) => false, - Ok(x) => f(x), - } - } - - /// Returns `true` if the result is [`Err`] and the value inside of it matches a predicate. - #[must_use] - #[inline] - fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool { - match self { - Ok(_) => false, - Err(e) => f(e), - } - } -}