|
|
|
|
|
by burntsushi
1406 days ago
|
|
Consider using anyhow. At that point, unwrap isn't a shortcut anymore except for one place: you are in a deeply nested function call and you suddenly realize you need to bubble up an error a few layers. Now you have to change a bunch of function signatures. I don't find myself in that position too frequently. Certainly not enough to warrant two identical but differently named functions. In that case, I would suggest coming up with your own pattern. Perhaps an unwrap() with a FIXME comment. Or a expect("FIXME"). |
|
That's the sort of thing that's a lot more effective if everyone does the same thing. So it's worth trying to standardise across the community.