fn build_uri(host: &str, path: &str) -> hyper::Uri {
    let url = if host.starts_with("http://") || host.starts_with("https://") {
        let host = host.trim_end_matches("/");
        format!("{}{}", host, path)
    } else if host == "localhost" || host.starts_with("localhost:") {
        format!("http://{}/.well-known/webnis{}", host, path)
    } else {
        format!("https://{}/.well-known/webnis{}", host, path)
    };
    url.parse::<hyper::Uri>().unwrap()
}
// build a hyper::Uri from a host and a path.
//
// host can be "hostname", "hostname:port", or "http(s)://hostname".
// if it's in the plain "hostname" format, the scheme will be http is
// the host is localhost, https otherwise.
build a hyper::Uri from a host and a path.
build a hyper :: Uri from a host and a path .
fn build_uri(host: &str, path: &str) -> hyper::Uri {
    let url = if host.starts_with("http://") || host.starts_with("https://") {
        let host = host.trim_end_matches("/");
        format!("{}{}", host, path)
    } else if host == "localhost" || host.starts_with("localhost:") {
        format!("http://{}/.well-known/webnis{}", host, path)
    } else {
        format!("https://{}/.well-known/webnis{}", host, path)
    };
    url.parse::<hyper::Uri>().unwrap()
}
fn build_uri ( host : & str , path : & str ) -> hyper :: Uri { let url = if host . starts_with ( " " ) || host . starts_with ( " " ) { let host = host . trim_end_matches ( " " ) ; format ! ( " " host path ) } else if host == " " || host . starts_with ( " " ) { format ! ( " " host path ) } else { format ! ( " " host path ) } ; url . parse :: < hyper :: Uri > ( ) . unwrap ( ) }
build a hyper::Uri from a host and a path.
build a hyper :: Uri from a host and a path .
host
&str
path
&str