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
Would it make sense to have a getter that returns a Result<&T, E>? e.g.
#[derive(EnumExpectGetters)]enumMyEnum{Foo(i32),Bar(String),}fnmain(){let foo = MyEnum::Foo(i32);let oops = "You can't do that!";assert_eq!(foo.expect_bar::<&str>(oops),Err(oops));}
or something like that? The only major problem I can immediately see is with it conflicting with result types that have one or both type parameters filled out (e.g. error-chain or std::io::Result).
The text was updated successfully, but these errors were encountered:
Would it make sense to have a getter that returns a
Result<&T, E>
? e.g.or something like that? The only major problem I can immediately see is with it conflicting with result types that have one or both type parameters filled out (e.g. error-chain or std::io::Result).
The text was updated successfully, but these errors were encountered: