8421 shaares
200 private links
200 private links
Since Rust 1.65:
let Some(user) = get_user() else {
return Err("No user".into());
};
The option can also be handled with .ok_or()
if it's recoverable.
The last solution is to use the match
statement.