|
|
|
|
|
by steveklabnik
2000 days ago
|
|
This code is equivalent to result.unwrap_or_else(|e| panic!("error traversing directories {}", e));
There are a lot of methods on various types to reduce this kind of thing. If you didn't want to interpolate the value of e, it would be even simpler: result.expect("error traversing directories");
|
|
For those reading along (not Steve) expect does do that, but using the Debug formatter instead of Display, as the grandparent used.