Implement range index with the Position enum on ServoUrl

This commit is contained in:
Pu Xingyu 2016-11-18 17:43:58 +08:00
parent 22aebdf5d4
commit 0818b44459
6 changed files with 35 additions and 6 deletions

View file

@ -931,7 +931,7 @@ pub fn load<A, B>(load_data: &LoadData,
// the source rather than rendering the contents of the URL.
let viewing_source = doc_url.scheme() == "view-source";
if viewing_source {
doc_url = ServoUrl::parse(&load_data.url.as_url().unwrap()[Position::BeforeUsername..]).unwrap();
doc_url = ServoUrl::parse(&load_data.url[Position::BeforeUsername..]).unwrap();
}
// Loop to handle redirects.