fn valid_port(string: String) -> Result<(), String> {
    match string.parse::<u32>() {
        Ok(num) if num > 1024 && num < 65536 => { Ok(()) }
        _ => { Err("Please provide a valid port (>1024)".to_string()) }
    }
}
/// Validate the correctness of the user provided Port
Validate the correctness of the user provided Port
Validate the correctness of the user provided Port
fn valid_port(string: String) -> Result<(), String> {
    match string.parse::<u32>() {
        Ok(num) if num > 1024 && num < 65536 => { Ok(()) }
        _ => { Err("Please provide a valid port (>1024)".to_string()) }
    }
}
fn valid_port ( string : String ) -> Result < ( ) , String > { match string . parse :: < u32 > ( ) { Ok ( num ) if num > 1024 && num < 65536 => { Ok ( ( ) ) } _ => { Err ( " " . to_string ( ) ) } } }
Validate the correctness of the user provided Port
Validate the correctness of the user provided Port
string
String
string
String