File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ assert!(Url::parse("http://[:::1]") == Err(ParseError::InvalidIpv6Address))
25
25
Let’s parse a valid URL and look at its components.
26
26
27
27
```
28
- use url::{Url, Host};
28
+ use url::{Url, Host, Position };
29
29
# use url::ParseError;
30
30
# fn run() -> Result<(), ParseError> {
31
31
let issue_list_url = Url::parse(
@@ -43,6 +43,7 @@ assert!(issue_list_url.path() == "/rust-lang/rust/issues");
43
43
assert!(issue_list_url.path_segments().map(|c| c.collect::<Vec<_>>()) ==
44
44
Some(vec!["rust-lang", "rust", "issues"]));
45
45
assert!(issue_list_url.query() == Some("labels=E-easy&state=open"));
46
+ assert!(&issue_list_url[Position::BeforePath..] == "/rust-lang/rust/issues?labels=E-easy&state=open");
46
47
assert!(issue_list_url.fragment() == None);
47
48
assert!(!issue_list_url.cannot_be_a_base());
48
49
# Ok(())
You can’t perform that action at this time.
0 commit comments