3 ms·
The equivalent in rust, for a fair comparison: Before: frobulate(message)?; After: frobulate(message).map_err(|e| { error!("error happened: {}
by TheDong 8y ago
The equivalent in rust, for a fair comparison:
Before:
frobulate(message)?;
After:
frobulate(message).map_err(|e| {
error!("error happened: {}", e);
e
})?;
// or, more like the go one
if let Err(e) = frobulate(message) {
error!("error: {}", e);
return Err(e);
}
It's really not that different in the debug case than go, but the normal case is less painful to deal with.