|
|
|
|
|
by dgellow
1586 days ago
|
|
Isn't "?" just a sugar for something like the following? That's how I think about it in my mind at least. // with "?"
let v = x?;
// without "?"
let v = match x {
Ok(o) => Ok(o),
Err(e) => return Err(e), // exit current scope due to the return
}.unwrap();
That feels like something that could be done with a macro. |
|
Indeed. It used to be a macro called try!.