Avoid some clones.

This commit is contained in:
Ms2ger 2016-04-29 13:33:22 +02:00
parent 78ae9a5da0
commit 703d018f23
5 changed files with 13 additions and 17 deletions

View file

@ -1344,7 +1344,7 @@ impl Document {
// The parser might need the loader, so restrict the lifetime of the borrow.
{
let mut loader = self.loader.borrow_mut();
loader.finish_load(load.clone());
loader.finish_load(&load);
}
if let LoadType::Script(_) = load {

View file

@ -144,7 +144,7 @@ impl HTMLIFrameElement {
pub fn process_the_iframe_attributes(&self) {
let url = match self.get_url() {
Some(url) => url.clone(),
Some(url) => url,
None => Url::parse("about:blank").unwrap(),
};

View file

@ -93,8 +93,8 @@ impl AsyncResponseListener for ParserContext {
Err(_) => None,
};
let content_type = metadata.clone().and_then(|meta| meta.content_type);
let parser = match ScriptThread::page_fetch_complete(self.id.clone(),
self.subpage.clone(),
let parser = match ScriptThread::page_fetch_complete(&self.id,
self.subpage.as_ref(),
metadata) {
Some(parser) => parser,
None => return,