Document btree's unwrap_unchecked

This commit is contained in:
Stein Somers 2020-07-23 20:15:47 +02:00
parent d92155bf6a
commit f42dac0ce0

View File

@ -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(|| {