In addition to what's been said, already, you may also want to consider using my_result?.do_something() and returning the Err to the caller and let them handle it. You can even return a Result from main. I highly recommend you to read the error tutorial posted on this forum.
2 Likes