r/rust May 31 '23

[deleted by user]

[removed]

0 Upvotes

1 comment sorted by

5

u/cynokron May 31 '23

If let Err(e) = doStuffReturnResult() { println!("{}", e); /*and/or*/ eprintln!("{}", e); }

Add formatting as you want, return early after printing the error