We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0d68d9 commit cf08bceCopy full SHA for cf08bce
src/lib.rs
@@ -57,6 +57,18 @@ pub enum Result<T> {
57
Err(Error),
58
}
59
60
+impl<T> Result<T> {
61
+ /// Obtain the inner value, or panic - just like `core::Result::unwrap`.
62
+ pub fn unwrap(self) -> T {
63
+ match self {
64
+ crate::Result::Ok(val) => val,
65
+ crate::Result::Err(e) => {
66
+ panic!("Unwrap called, got err {:?}", e);
67
+ }
68
69
70
+}
71
+
72
/// All API functions which take/return optional values return this type. We
73
/// don't use the `Option` type from the standard library because that isn't
74
/// FFI safe and may change layout between compiler versions.
0 commit comments