You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// An enum to choose which type of unwrap to use. When using `Unwrap::Err`, the/// result must be an `Err` or the test will panic. If the result contains an/// `Err`, the test will pass only if the error message contains the provided/// string.pubenumUnwrap{/// Unwrap the result, expecting it to be `Ok`.Ok,/// Unwrap the result, expecting it to be `Err`. The error message must/// contain the provided string.Err(&'static str),/// Call `ok()` on the result, returning `None` if it is an `Err`.IgnoreErr,}implUnwrap{pubfnunwrap<T:Debug,E:Debug>(self,result:Result<T,E>) -> Option<T>{matchself{Unwrap::Ok => {let res = result.unwrap();Some(res)}Unwrap::Err(s) => {let err = result.unwrap_err();assert!(
format!("{:?}", err).contains(s),"Expected error message to contain {:?}, got {:?}",
s,
err
);None}Unwrap::IgnoreErr => result.ok(),}}}
No description provided.
The text was updated successfully, but these errors were encountered: