5 ms·
> An unwrap() is a dev explicitly saying this should always contain a value Isn't expect() supposed to cover that case?
by vaylian 5y ago
> An unwrap() is a dev explicitly saying this should always contain a value
Isn't expect() supposed to cover that case?
- rowanG077 5y agoNo it's the opposite. Unwrap() means the dev said this will never not be set. Expect() is saying if this value is not available exit the program with this user facing error message.
- ModernMech 5y agoexpect() is like unwrap() but you can give a message as an argument.