How to handle this weird construct

I'm sorry for the bad title but I really can't find any way to describe this. I want a function attempt_connection to try to connect to a server using a TcpStream. When it has made that call, I want it to either return the TcpStream OR in case of an error, print out the error message and then call handle_menu. I have been fiddling around with this for over an hour and can't get things to work out. I am quite new to rust and would apreciate any help.

Never mind I just remembered that I can use Option and Some instead of just a Result.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.