pub fn to_url(addr: String, port: u16) -> Result<Url, UrlError> {
    (addr, port)
        .to_socket_addrs()
        .map_err(|e| UrlError::Io(e))?
        .next()
        .ok_or(UrlError::InvalidUrl)
        .map(|a| format!("http://{}", a))
        .and_then(|s| {
            Url::parse(&s)
                .map_err(|e| UrlError::Parse(e))
        })
}
/// Converts the given string to a URL.
Converts the given string to a URL.
Converts the given string to a URL .
pub fn to_url(addr: String, port: u16) -> Result<Url, UrlError> {
    (addr, port)
        .to_socket_addrs()
        .map_err(|e| UrlError::Io(e))?
        .next()
        .ok_or(UrlError::InvalidUrl)
        .map(|a| format!("http://{}", a))
        .and_then(|s| {
            Url::parse(&s)
                .map_err(|e| UrlError::Parse(e))
        })
}
pub fn to_url ( addr : String , port : u16 ) -> Result < Url , UrlError > { ( addr , port ) . to_socket_addrs ( ) . map_err ( | e | UrlError :: Io ( e ) ) ? . next ( ) . ok_or ( UrlError :: InvalidUrl ) . map ( | a | format ! ( " " a ) ) . and_then ( | s | { Url :: parse ( & s ) . map_err ( | e | UrlError :: Parse ( e ) ) } ) }
Converts the given string to a URL.
Converts the given string to a URL .
addr
String
port
u16
addr
String
port
u16