Hi, I'm writing a new CLI tool and I'm using clap-rs for argument parsing.
In this tool you can specify in which port you wan't to listen TCP connections using the "-p PORT" flag. As you know, ports range is from 0 to 2^16. If the user put something out of this range I wan't to notify it through an error message and set port value to 8080.
This is my code:
My question is: Is there a better way to achieve this ?