aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/html/hubbub_html_parser.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-07-24 12:36:53 +0200
committerMs2ger <ms2ger@gmail.com>2014-07-24 12:36:53 +0200
commite363b6fcc4ee8d27f9a38b2af229d64b84116965 (patch)
tree60cc1e1ccf83a05f13e7f3119f43294d9befc4da /src/components/script/html/hubbub_html_parser.rs
parent800b5e0f4aeef541a54f0ea25061964d2ddb4fc0 (diff)
downloadservo-e363b6fcc4ee8d27f9a38b2af229d64b84116965.tar.gz
servo-e363b6fcc4ee8d27f9a38b2af229d64b84116965.zip
Avoid an unnecessary clone of the base URL in parse_html().
Diffstat (limited to 'src/components/script/html/hubbub_html_parser.rs')
-rw-r--r--src/components/script/html/hubbub_html_parser.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs
index a53acea4115..8b7ee5440b7 100644
--- a/src/components/script/html/hubbub_html_parser.rs
+++ b/src/components/script/html/hubbub_html_parser.rs
@@ -319,7 +319,7 @@ pub fn parse_html(page: &Page,
debug!("Fetched page; metadata is {:?}", load_response.metadata);
- let base_url = load_response.metadata.final_url.clone();
+ let base_url = &load_response.metadata.final_url;
{
// Store the final URL before we start parsing, so that DOM routines
@@ -414,7 +414,7 @@ pub fn parse_html(page: &Page,
s.as_slice().eq_ignore_ascii_case("stylesheet")
}) => {
debug!("found CSS stylesheet: {:s}", *href);
- match UrlParser::new().base_url(&base_url).parse(href.as_slice()) {
+ match UrlParser::new().base_url(base_url).parse(href.as_slice()) {
Ok(url) => css_chan2.send(CSSTaskNewFile(
UrlProvenance(url, resource_task.clone()))),
Err(e) => debug!("Parsing url {:s} failed: {:s}", *href, e)
@@ -498,7 +498,7 @@ pub fn parse_html(page: &Page,
match script.get_attribute(Null, "src").root() {
Some(src) => {
debug!("found script: {:s}", src.deref().Value());
- match UrlParser::new().base_url(&base_url)
+ match UrlParser::new().base_url(base_url)
.parse(src.deref().value().as_slice()) {
Ok(new_url) => js_chan2.send(JSTaskNewFile(new_url)),
Err(e) => debug!("Parsing url {:s} failed: {:s}", src.deref().Value(), e)