fn connect_socket(unit: &Unit, hostname: &str) -> Result<Stream, Error> {
    match unit.url.scheme() {
        "http" | "https" | "test" => (),
        scheme => return Err(ErrorKind::UnknownScheme.msg(&format!("unknown scheme '{}'", scheme))),
    };
    let stream = match unit.url.scheme() {
        "http" => stream::connect_http(unit, hostname),
        "https" => stream::connect_https(unit, hostname),
        "test" => connect_test(unit),
        scheme => Err(ErrorKind::UnknownScheme.msg(&format!("unknown scheme {}", scheme))),
    }?;
    Ok(stream)
}
/// Connect the socket, either by using the pool or grab a new one.
Connect the socket, either by using the pool or grab a new one.
Connect the socket either by using the pool or grab a new one .
fn connect_socket(unit: &Unit, hostname: &str) -> Result<Stream, Error> {
    match unit.url.scheme() {
        "http" | "https" | "test" => (),
        scheme => return Err(ErrorKind::UnknownScheme.msg(&format!("unknown scheme '{}'", scheme))),
    };
    let stream = match unit.url.scheme() {
        "http" => stream::connect_http(unit, hostname),
        "https" => stream::connect_https(unit, hostname),
        "test" => connect_test(unit),
        scheme => Err(ErrorKind::UnknownScheme.msg(&format!("unknown scheme {}", scheme))),
    }?;
    Ok(stream)
}
fn connect_socket ( unit : & Unit , hostname : & str ) -> Result < Stream , Error > { match unit . url . scheme ( ) { " " | " " | " " => ( ) , scheme => return Err ( ErrorKind :: UnknownScheme . msg ( & format ! ( " " scheme ) ) ) , } ; let stream = match unit . url . scheme ( ) { " " => stream :: connect_http ( unit , hostname ) , " " => stream :: connect_https ( unit , hostname ) , " " => connect_test ( unit ) , scheme => Err ( ErrorKind :: UnknownScheme . msg ( & format ! ( " " scheme ) ) ) , } ? ; Ok ( stream ) }
Connect the socket, either by using the pool or grab a new one.
Connect the socket either by using the pool or grab a new one .
unit
&Unit
hostname
&str
unit
&Unit
hostname
&str