fn parse_tls_version(text: &str) -> Option<tls::Version> {
    match text {
        // ssl2.3 is not a real version but it's how HTTPie spells "auto"
        "auto" | "ssl2.3" => None,
        "tls1" => Some(tls::Version::TLS_1_0),
        "tls1.1" => Some(tls::Version::TLS_1_1),
        "tls1.2" => Some(tls::Version::TLS_1_2),
        "tls1.3" => Some(tls::Version::TLS_1_3),
        _ => unreachable!(),
    }
}
/// The caller must check in advance if the string is valid. (structopt does this.)
The caller must check in advance if the string is valid. (structopt does this.)
The caller must check in advance if the string is valid . ( structopt does this . )
fn parse_tls_version(text: &str) -> Option<tls::Version> {
    match text {
        // ssl2.3 is not a real version but it's how HTTPie spells "auto"
        "auto" | "ssl2.3" => None,
        "tls1" => Some(tls::Version::TLS_1_0),
        "tls1.1" => Some(tls::Version::TLS_1_1),
        "tls1.2" => Some(tls::Version::TLS_1_2),
        "tls1.3" => Some(tls::Version::TLS_1_3),
        _ => unreachable!(),
    }
}
fn parse_tls_version ( text : & str ) -> Option < tls :: Version > { match text { // ssl2.3 is not a real version but it's how HTTPie spells "auto" " " | " " => None , " " => Some ( tls :: Version :: TLS_1_0 ) , " " => Some ( tls :: Version :: TLS_1_1 ) , " " => Some ( tls :: Version :: TLS_1_2 ) , " " => Some ( tls :: Version :: TLS_1_3 ) , _ => unreachable ! ( ) , } }
The caller must check in advance if the string is valid.
The caller must check in advance if the string is valid .
text
&str
text
&str