you are viewing a single comment's thread
view the rest of the comments
[–] 10 points 3 months ago

I think this is more idiomatic:

let result = foo(a, b)
    .map_err(|e| MyErrorEnum::Error(e.to_string()));
  • source
  • parent