INNER CODE UNIT · Rust

replace

fishfolk/bones · framework_crates/bones_asset/src/lib.rs:211

    pub fn replace(&mut self, value: T) -> Maybe<T> {
        std::mem::replace(self, Maybe::Set(value))
    }

    /// Zips `self` with another `Maybe`.
    #[inline]
    pub fn zip<U>(self, other: Maybe<U>) -> Maybe<(T, U)> {
        self.option().zip(other.option()).into()
    }

    /// Returns the contained `Set` value, consuming the `self` value, without checking that the value is not `Unset`.
    ///
    /// # Safety
    ///
    /// Calling this method on an `Unset` value is undefined behavior.
    #[inline]
    pub unsafe fn unwrap_unchecked(self) -> T {
        self.option().unwrap_unchecked()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…