mirl 9.2.0

Miners Rust Lib - A massive collection of ever growing and changing functions, structs, and enums. Check the description for compatibility and toggleable features! (Most of the lib is controlled by flags/features so the lib can continue to be lightweight despite its size)
use crate::prelude::{FromPatch, IsPrimitive};

/// The inverse of [`TryFromPatch`]
pub const trait TryIntoPatch<T>: Sized {
    #[must_use]
    /// A custom from to bypass rusts orphan rule
    fn try_into_value(self) -> Option<T>;
}
impl<T: Sized + TryFromPatch<O>, O> TryIntoPatch<T> for O {
    fn try_into_value(self) -> Option<T> {
        T::try_from_value(self)
    }
}

/// Lets you convert from one value to another.
///
/// What's the difference between this and [`core::convert::TryFrom`]?
/// [`core::convert::TryFrom`] has many holes covered by [`core::convert::From`], this inconveniences things.
/// This trait "patches" the [`core::convert::TryFrom`] by combining both traits and adding even more
pub const trait TryFromPatch<T>: Sized {
    #[must_use]
    /// A custom from to bypass rusts orphan rule
    fn try_from_value(value: T) -> Option<Self>;
}

impl<T: FromPatch<V> + IsPrimitive, V> TryFromPatch<V> for T {
    fn try_from_value(value: V) -> Option<Self> {
        Some(T::from_value(value))
    }
}

#[cfg(feature = "std")]
mod map;
mod numbers;
#[cfg(feature = "std")]
mod string;
#[cfg(feature = "std")]
mod vec;