Document btree's unwrap_unchecked
This commit is contained in:
parent
d92155bf6a
commit
f42dac0ce0
@ -13,6 +13,9 @@ trait Recover<Q: ?Sized> {
|
||||
fn replace(&mut self, key: Self::Key) -> Option<Self::Key>;
|
||||
}
|
||||
|
||||
/// Same purpose as `Option::unwrap` but doesn't always guarantee a panic
|
||||
/// if the option contains no value.
|
||||
/// SAFETY: the caller must ensure that the option contains a value.
|
||||
#[inline(always)]
|
||||
pub unsafe fn unwrap_unchecked<T>(val: Option<T>) -> T {
|
||||
val.unwrap_or_else(|| {
|
||||
|
Loading…
Reference in New Issue
Block a user