mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Avoid some clones.
This commit is contained in:
parent
78ae9a5da0
commit
703d018f23
5 changed files with 13 additions and 17 deletions
|
@ -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 {
|
||||
|
|
|
@ -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(),
|
||||
};
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue