mod.rs.html -- source
Description: Source to the Rust file `src/liballoc/collections/btree/mod.rs`.
Keywords: rust, rustlang, rust-lang

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27

    pub mod map;
    mod navigate;
    mod node;
    mod search;
    pub mod set;

    #[doc(hidden)]
    trait Recover<Q: ?Sized> {
        type Key;

        fn get(&self, key: &Q) -> Option<&Self::Key>;
        fn take(&mut self, key: &Q) -> Option<Self::Key>;
        fn replace(&mut self, key: Self::Key) -> Option<Self::Key>;
    }

    #[inline(always)]
    pub unsafe fn unwrap_unchecked<T>(val: Option<T>) -> T {
        val.unwrap_or_else(|| {
            if cfg!(debug_assertions) {
                panic!("'unchecked' unwrap on None in BTreeMap");
            } else {
                unsafe {
                    core::intrinsics::unreachable();
                }
            }
        })
    }