let uri = get_uri_from_stdin();
networking_library::make_request(uri);
How is the compiler supposed to prune that? let uri = get_uri_from_stdin();
networking_library::make_request(uri);
How is the compiler supposed to prune that? let uri: Uri<HTTP> = get_uri_from_stdin().parse()?;
If the library is made in a modular way this is how it would typically be done. The `HTTP` may be inferred by calls further along in the function.If you want to mix schemes you would need to be able to handle all schemes; you can either go through all variations (through the same generics) you want to test or just just accept that you need a full URI parser and lose the generic.
let uri: Uri<FTP or HTTP or HTTPS> = parse_uri(get_uri_from_stdin()) or fail;If your library cannot parse FTP, either you enable that feature, add that feature, or use a different library.