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))
2525Let’s parse a valid URL and look at its components.
2626
2727```
28- use url::{Url, Host};
28+ use url::{Url, Host, Position };
2929# use url::ParseError;
3030# fn run() -> Result<(), ParseError> {
3131let issue_list_url = Url::parse(
@@ -43,6 +43,7 @@ assert!(issue_list_url.path() == "/rust-lang/rust/issues");
4343assert!(issue_list_url.path_segments().map(|c| c.collect::<Vec<_>>()) ==
4444 Some(vec!["rust-lang", "rust", "issues"]));
4545assert!(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");
4647assert!(issue_list_url.fragment() == None);
4748assert!(!issue_list_url.cannot_be_a_base());
4849# Ok(())
You can’t perform that action at this time.
0 commit comments