| 1 | #[cfg(feature = "net")] |
| 2 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::netrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/::{Ipv4Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv4Addr#, Ipv6Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv6Addr#}; |
| 3 | |
| 4 | use fluent_urirust-analyzer cargo fluent-uri 0.4.1 crate/::{componentrust-analyzer cargo fluent-uri 0.4.1 component/::Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#, pct_encrust-analyzer cargo fluent-uri 0.4.1 pct_enc/::EStrrust-analyzer cargo fluent-uri 0.4.1 pct_enc/EStr#, ParseErrorKindrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#, Urirust-analyzer cargo fluent-uri 0.4.1 imp/Uri#, UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#}; |
| 5 | |
| 6 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 7 | fn parse_absoluterust-analyzer cargo fluent-uri 0.4.1 parse_absolute().() { |
| 8 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("file:///etc/hosts").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 9 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.as_strrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]as_str().(), "file:///etc/hosts"); |
| 10 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[Scheme]as_str().(), "file"); |
| 11 | let a = r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 12 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]as_str().(), ""); |
| 13 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.userinforust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]userinfo().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 14 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.hostrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host().(), ""); |
| 15 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(a.host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(), Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::RegNamerust-analyzer cargo fluent-uri 0.4.1 component/Host#RegName#(n) if n.is_emptyrust-analyzer cargo fluent-uri 0.4.1 pct_enc/impl#[`EStr<E>`]is_empty().())); |
| 16 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.portrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]port().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 17 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "/etc/hosts"); |
| 18 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 19 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 20 | |
| 21 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("ftp://ftp.is.co.za/rfc/rfc1808.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 22 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[Scheme]as_str().(), "ftp"); |
| 23 | let a = r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 24 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]as_str().(), "ftp.is.co.za"); |
| 25 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.userinforust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]userinfo().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 26 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.hostrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host().(), "ftp.is.co.za"); |
| 27 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(a.host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(), Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::RegNamerust-analyzer cargo fluent-uri 0.4.1 component/Host#RegName#(name) if name == "ftp.is.co.za")); |
| 28 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.portrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]port().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 29 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "/rfc/rfc1808.txt"); |
| 30 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 31 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 32 | |
| 33 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("http://www.ietf.org/rfc/rfc2396.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 34 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[Scheme]as_str().(), "http"); |
| 35 | let a = r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 36 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]as_str().(), "www.ietf.org"); |
| 37 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.userinforust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]userinfo().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 38 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.hostrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host().(), "www.ietf.org"); |
| 39 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(a.host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(), Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::RegNamerust-analyzer cargo fluent-uri 0.4.1 component/Host#RegName#(name) if name == "www.ietf.org")); |
| 40 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.portrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]port().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 41 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "/rfc/rfc2396.txt"); |
| 42 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 43 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 44 | |
| 45 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("ldap://[2001:db8::7]/c=GB?objectClass?one").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 46 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[Scheme]as_str().(), "ldap"); |
| 47 | let a = r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 48 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]as_str().(), "[2001:db8::7]"); |
| 49 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.userinforust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]userinfo().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 50 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.hostrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host().(), "[2001:db8::7]"); |
| 51 | #[cfg(feature = "net")] |
| 52 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!( |
| 53 | a.host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(), |
| 54 | Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::Ipv6rust-analyzer cargo fluent-uri 0.4.1 component/Host#Ipv6#(addr) if addr == Ipv6Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv6Addr#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv6Addr]new().(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0x7) |
| 55 | )); |
| 56 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.portrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]port().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 57 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "/c=GB"); |
| 58 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(EStrrust-analyzer cargo fluent-uri 0.4.1 pct_enc/EStr#::new_or_panicrust-analyzer cargo fluent-uri 0.4.1 pct_enc/impl#[`EStr<E>`]new_or_panic().("objectClass?one"))); |
| 59 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 60 | |
| 61 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("mailto:[email protected]").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 62 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[Scheme]as_str().(), "mailto"); |
| 63 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 64 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "[email protected]"); |
| 65 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 66 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 67 | |
| 68 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("news:comp.infosystems.www.servers.unix").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 69 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[Scheme]as_str().(), "news"); |
| 70 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 71 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "comp.infosystems.www.servers.unix"); |
| 72 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 73 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 74 | |
| 75 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("tel:+1-816-555-1212").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 76 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[Scheme]as_str().(), "tel"); |
| 77 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 78 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "+1-816-555-1212"); |
| 79 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 80 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 81 | |
| 82 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("telnet://192.0.2.16:80/").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 83 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[Scheme]as_str().(), "telnet"); |
| 84 | let a = r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 85 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]as_str().(), "192.0.2.16:80"); |
| 86 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.userinforust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]userinfo().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 87 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.hostrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host().(), "192.0.2.16"); |
| 88 | #[cfg(feature = "net")] |
| 89 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(a.host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(), Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::Ipv4rust-analyzer cargo fluent-uri 0.4.1 component/Host#Ipv4#(addr) if addr == Ipv4Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv4Addr#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv4Addr]new().(192, 0, 2, 16))); |
| 90 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.portrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]port().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(EStrrust-analyzer cargo fluent-uri 0.4.1 pct_enc/EStr#::new_or_panicrust-analyzer cargo fluent-uri 0.4.1 pct_enc/impl#[`EStr<E>`]new_or_panic().("80"))); |
| 91 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "/"); |
| 92 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 93 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 94 | |
| 95 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("urn:oasis:names:specification:docbook:dtd:xml:4.1.2").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 96 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[Scheme]as_str().(), "urn"); |
| 97 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 98 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "oasis:names:specification:docbook:dtd:xml:4.1.2"); |
| 99 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 100 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 101 | |
| 102 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("foo://example.com:8042/over/there?name=ferret#nose").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 103 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[Scheme]as_str().(), "foo"); |
| 104 | let a = r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 105 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]as_str().(), "example.com:8042"); |
| 106 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.userinforust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]userinfo().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 107 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.hostrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host().(), "example.com"); |
| 108 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(a.host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(), Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::RegNamerust-analyzer cargo fluent-uri 0.4.1 component/Host#RegName#(name) if name == "example.com")); |
| 109 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.portrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]port().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(EStrrust-analyzer cargo fluent-uri 0.4.1 pct_enc/EStr#::new_or_panicrust-analyzer cargo fluent-uri 0.4.1 pct_enc/impl#[`EStr<E>`]new_or_panic().("8042"))); |
| 110 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "/over/there"); |
| 111 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(EStrrust-analyzer cargo fluent-uri 0.4.1 pct_enc/EStr#::new_or_panicrust-analyzer cargo fluent-uri 0.4.1 pct_enc/impl#[`EStr<E>`]new_or_panic().("name=ferret"))); |
| 112 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(EStrrust-analyzer cargo fluent-uri 0.4.1 pct_enc/EStr#::new_or_panicrust-analyzer cargo fluent-uri 0.4.1 pct_enc/impl#[`EStr<E>`]new_or_panic().("nose"))); |
| 113 | |
| 114 | let r = |
| 115 | UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("ftp://cnn.example.com&[email protected]/top_story.htm").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 116 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[Scheme]as_str().(), "ftp"); |
| 117 | let a = r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 118 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]as_str().(), "cnn.example.com&[email protected]"); |
| 119 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 120 | a.userinforust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]userinfo().(), |
| 121 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(EStrrust-analyzer cargo fluent-uri 0.4.1 pct_enc/EStr#::new_or_panicrust-analyzer cargo fluent-uri 0.4.1 pct_enc/impl#[`EStr<E>`]new_or_panic().("cnn.example.com&story=breaking_news")) |
| 122 | ); |
| 123 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.hostrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host().(), "10.0.0.1"); |
| 124 | #[cfg(feature = "net")] |
| 125 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(a.host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(), Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::Ipv4rust-analyzer cargo fluent-uri 0.4.1 component/Host#Ipv4#(addr) if addr == Ipv4Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv4Addr#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv4Addr]new().(10, 0, 0, 1))); |
| 126 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.portrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]port().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 127 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "/top_story.htm"); |
| 128 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 129 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 130 | |
| 131 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("http://[vFe.foo.bar]").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 132 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[Scheme]as_str().(), "http"); |
| 133 | let a = r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 134 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]as_str().(), "[vFe.foo.bar]"); |
| 135 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.userinforust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]userinfo().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 136 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.hostrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host().(), "[vFe.foo.bar]"); |
| 137 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(a.host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(), Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::IpvFuturerust-analyzer cargo fluent-uri 0.4.1 component/Host#IpvFuture# { .. })); |
| 138 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.portrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]port().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 139 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), ""); |
| 140 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 141 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 142 | |
| 143 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("http://127.0.0.1:/").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 144 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[Scheme]as_str().(), "http"); |
| 145 | let a = r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 146 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]as_str().(), "127.0.0.1:"); |
| 147 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.userinforust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]userinfo().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 148 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.hostrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host().(), "127.0.0.1"); |
| 149 | #[cfg(feature = "net")] |
| 150 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(a.host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(), Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::Ipv4rust-analyzer cargo fluent-uri 0.4.1 component/Host#Ipv4#(addr) if addr == Ipv4Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv4Addr#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv4Addr]new().(127, 0, 0, 1))); |
| 151 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.portrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]port().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(EStrrust-analyzer cargo fluent-uri 0.4.1 pct_enc/EStr#::EMPTYrust-analyzer cargo fluent-uri 0.4.1 pct_enc/impl#[`EStr<E>`]EMPTY.)); |
| 152 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "/"); |
| 153 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 154 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 155 | |
| 156 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("http://127.0.0.1:8080/").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 157 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[Scheme]as_str().(), "http"); |
| 158 | let a = r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 159 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]as_str().(), "127.0.0.1:8080"); |
| 160 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.userinforust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]userinfo().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 161 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.hostrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host().(), "127.0.0.1"); |
| 162 | #[cfg(feature = "net")] |
| 163 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(a.host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(), Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::Ipv4rust-analyzer cargo fluent-uri 0.4.1 component/Host#Ipv4#(addr) if addr == Ipv4Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv4Addr#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv4Addr]new().(127, 0, 0, 1))); |
| 164 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.portrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]port().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(EStrrust-analyzer cargo fluent-uri 0.4.1 pct_enc/EStr#::new_or_panicrust-analyzer cargo fluent-uri 0.4.1 pct_enc/impl#[`EStr<E>`]new_or_panic().("8080"))); |
| 165 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "/"); |
| 166 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 167 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 168 | |
| 169 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("http://127.0.0.1:80808/").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 170 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[Scheme]as_str().(), "http"); |
| 171 | let a = r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 172 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]as_str().(), "127.0.0.1:80808"); |
| 173 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.userinforust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]userinfo().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 174 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.hostrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host().(), "127.0.0.1"); |
| 175 | #[cfg(feature = "net")] |
| 176 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(a.host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(), Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::Ipv4rust-analyzer cargo fluent-uri 0.4.1 component/Host#Ipv4#(addr) if addr == Ipv4Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv4Addr#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv4Addr]new().(127, 0, 0, 1))); |
| 177 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.portrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]port().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(EStrrust-analyzer cargo fluent-uri 0.4.1 pct_enc/EStr#::new_or_panicrust-analyzer cargo fluent-uri 0.4.1 pct_enc/impl#[`EStr<E>`]new_or_panic().("80808"))); |
| 178 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "/"); |
| 179 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 180 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 181 | } |
| 182 | |
| 183 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 184 | fn parse_relativerust-analyzer cargo fluent-uri 0.4.1 parse_relative().() { |
| 185 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 186 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 187 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 188 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), ""); |
| 189 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 190 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 191 | |
| 192 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("foo.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 193 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 194 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 195 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "foo.txt"); |
| 196 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 197 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 198 | |
| 199 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().(".").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 200 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 201 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 202 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "."); |
| 203 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 204 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 205 | |
| 206 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("./this:that").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 207 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 208 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 209 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), "./this:that"); |
| 210 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 211 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 212 | |
| 213 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("//example.com").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 214 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 215 | let a = r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 216 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.as_strrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]as_str().(), "example.com"); |
| 217 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.userinforust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]userinfo().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 218 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.hostrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host().(), "example.com"); |
| 219 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(a.host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(), Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::RegNamerust-analyzer cargo fluent-uri 0.4.1 component/Host#RegName#(name) if name == "example.com")); |
| 220 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.portrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]port().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 221 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), ""); |
| 222 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 223 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 224 | |
| 225 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("?query").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 226 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 227 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 228 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), ""); |
| 229 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(EStrrust-analyzer cargo fluent-uri 0.4.1 pct_enc/EStr#::new_or_panicrust-analyzer cargo fluent-uri 0.4.1 pct_enc/impl#[`EStr<E>`]new_or_panic().("query"))); |
| 230 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 231 | |
| 232 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("#fragment").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 233 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.schemerust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]scheme().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 234 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 235 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.pathrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]path().(), ""); |
| 236 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.queryrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]query().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 237 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(r.fragmentrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]fragment().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(EStrrust-analyzer cargo fluent-uri 0.4.1 pct_enc/EStr#::new_or_panicrust-analyzer cargo fluent-uri 0.4.1 pct_enc/impl#[`EStr<E>`]new_or_panic().("fragment"))); |
| 238 | } |
| 239 | |
| 240 | use ParseErrorKindrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#::*; |
| 241 | |
| 242 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 243 | fn parse_error_urirust-analyzer cargo fluent-uri 0.4.1 parse_error_uri().() { |
| 244 | #[track_caller] |
| 245 | fn failrust-analyzer cargo fluent-uri 0.4.1 fail().(input: &str, index: usize, kind: ParseErrorKindrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#) { |
| 246 | let e = Urirust-analyzer cargo fluent-uri 0.4.1 imp/Uri#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`Uri<T>`]parse().(input).unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().(); |
| 247 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(e.indexrust-analyzer cargo fluent-uri 0.4.1 parse/impl#[ParseError]index().(), index); |
| 248 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(e.kindrust-analyzer cargo fluent-uri 0.4.1 parse/impl#[ParseError]kind().(), kind); |
| 249 | } |
| 250 | |
| 251 | // No scheme |
| 252 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("foo", 3, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 253 | |
| 254 | // Empty scheme |
| 255 | failrust-analyzer cargo fluent-uri 0.4.1 fail().(":hello", 0, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 256 | |
| 257 | // Scheme starts with non-letter |
| 258 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("3ttp://a.com", 0, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 259 | |
| 260 | // Unexpected char in scheme |
| 261 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("exam=ple:foo", 4, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 262 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("(:", 0, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 263 | |
| 264 | // Percent-encoded scheme |
| 265 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("a%20:foo", 1, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 266 | } |
| 267 | |
| 268 | #[track_caller] |
| 269 | fn failrust-analyzer cargo fluent-uri 0.4.1 fail().(input: &str, index: usize, kind: ParseErrorKindrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#) { |
| 270 | let e = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().(input).unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().(); |
| 271 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(e.indexrust-analyzer cargo fluent-uri 0.4.1 parse/impl#[ParseError]index().(), index); |
| 272 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(e.kindrust-analyzer cargo fluent-uri 0.4.1 parse/impl#[ParseError]kind().(), kind); |
| 273 | } |
| 274 | |
| 275 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 276 | fn parse_error_uri_refrust-analyzer cargo fluent-uri 0.4.1 parse_error_uri_ref().() { |
| 277 | // Empty scheme |
| 278 | failrust-analyzer cargo fluent-uri 0.4.1 fail().(":hello", 0, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 279 | |
| 280 | // Scheme starts with non-letter |
| 281 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("3ttp://a.com", 0, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 282 | |
| 283 | // After rewriting the parser, the following two cases are interpreted as |
| 284 | // containing colon in the first path segment of a relative reference. |
| 285 | |
| 286 | // Unexpected char in scheme |
| 287 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("exam=ple:foo", 8, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 288 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("(:", 1, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 289 | |
| 290 | // Percent-encoded scheme |
| 291 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("a%20:foo", 4, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 292 | |
| 293 | // Unexpected char in path |
| 294 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("foo\\bar", 3, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 295 | |
| 296 | // Non-hexadecimal percent-encoded octet |
| 297 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("foo%xxd", 3, InvalidPctEncodedOctetrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#InvalidPctEncodedOctet#); |
| 298 | |
| 299 | // Incomplete percent-encoded octet |
| 300 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("text%a", 4, InvalidPctEncodedOctetrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#InvalidPctEncodedOctet#); |
| 301 | |
| 302 | // A single percent |
| 303 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("%", 0, InvalidPctEncodedOctetrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#InvalidPctEncodedOctet#); |
| 304 | |
| 305 | // Non-decimal port |
| 306 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("http://example.com:80ab", 21, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 307 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("http://[email protected]:80ab", 26, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 308 | |
| 309 | // Multiple colons in authority |
| 310 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("http://user:pass:example.com/", 16, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 311 | |
| 312 | // Unclosed bracket |
| 313 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("https://[::1/", 12, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 314 | |
| 315 | // Not port after IP literal |
| 316 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("https://[::1]wrong", 13, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 317 | |
| 318 | // IP literal too short |
| 319 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("http://[:]", 8, InvalidIpv6Addrrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#InvalidIpv6Addr#); |
| 320 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("http://[]", 8, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 321 | |
| 322 | // Non-hexadecimal version in IPvFuture |
| 323 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("http://[vG.addr]", 9, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 324 | |
| 325 | // Empty version in IPvFuture |
| 326 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("http://[v.addr]", 9, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 327 | |
| 328 | // Empty address in IPvFuture |
| 329 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("ftp://[vF.]", 10, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 330 | |
| 331 | // Percent-encoded address in IPvFuture |
| 332 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("ftp://[vF.%20]", 10, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 333 | |
| 334 | // With zone identifier |
| 335 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("ftp://[fe80::abcd%eth0]", 17, UnexpectedCharrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#UnexpectedChar#); |
| 336 | |
| 337 | // Invalid IPv6 address |
| 338 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("example://[44:55::66::77]", 11, InvalidIpv6Addrrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#InvalidIpv6Addr#); |
| 339 | } |
| 340 | |
| 341 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 342 | fn strict_ip_addrrust-analyzer cargo fluent-uri 0.4.1 strict_ip_addr().() { |
| 343 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("//127.0.0.001").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 344 | let a = r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 345 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(a.host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(), Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::RegNamerust-analyzer cargo fluent-uri 0.4.1 component/Host#RegName#(_))); |
| 346 | |
| 347 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("//127.1").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 348 | let a = r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 349 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(a.host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(), Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::RegNamerust-analyzer cargo fluent-uri 0.4.1 component/Host#RegName#(_))); |
| 350 | |
| 351 | let r = UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("//127.00.00.1").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 352 | let a = r.authorityrust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]authority().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 353 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(a.host_parsedrust-analyzer cargo fluent-uri 0.4.1 component/impl#[`Authority<'a, UserinfoE, RegNameE>`]host_parsed().(), Hostrust-analyzer cargo fluent-uri 0.4.1 component/Host#::RegNamerust-analyzer cargo fluent-uri 0.4.1 component/Host#RegName#(_))); |
| 354 | |
| 355 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("//[::1.1.1.1]").is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().()); |
| 356 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("//[::ffff:1.1.1.1]").is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().()); |
| 357 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(UriRefrust-analyzer cargo fluent-uri 0.4.1 imp/UriRef#::parserust-analyzer cargo fluent-uri 0.4.1 imp/impl#[`UriRef<T>`]parse().("//[0000:0000:0000:0000:0000:0000:255.255.255.255]").is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().()); |
| 358 | |
| 359 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("//[::01.1.1.1]", 3, InvalidIpv6Addrrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#InvalidIpv6Addr#); |
| 360 | failrust-analyzer cargo fluent-uri 0.4.1 fail().("//[::00.1.1.1]", 3, InvalidIpv6Addrrust-analyzer cargo fluent-uri 0.4.1 parse/ParseErrorKind#InvalidIpv6Addr#); |
| 361 | } |