We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d92155b commit f42dac0Copy full SHA for f42dac0
library/alloc/src/collections/btree/mod.rs
@@ -13,6 +13,9 @@ trait Recover<Q: ?Sized> {
13
fn replace(&mut self, key: Self::Key) -> Option<Self::Key>;
14
}
15
16
+/// Same purpose as `Option::unwrap` but doesn't always guarantee a panic
17
+/// if the option contains no value.
18
+/// SAFETY: the caller must ensure that the option contains a value.
19
#[inline(always)]
20
pub unsafe fn unwrap_unchecked<T>(val: Option<T>) -> T {
21
val.unwrap_or_else(|| {
0 commit comments