aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/webdriver_handlers.rs
diff options
context:
space:
mode:
authorPu Xingyu <pu.stshine@gmail.com>2016-11-18 12:39:22 +0800
committerPu Xingyu <pu.stshine@gmail.com>2016-11-18 12:39:22 +0800
commit91f3d4f4749a1dd53d665f741be85559b820cbe7 (patch)
tree0170b480610acde6aa39867bdf581c4d6d352022 /components/script/webdriver_handlers.rs
parentfb6cc15208690acb4c66445b71f2ff8d1dcfcf73 (diff)
downloadservo-91f3d4f4749a1dd53d665f741be85559b820cbe7.tar.gz
servo-91f3d4f4749a1dd53d665f741be85559b820cbe7.zip
Remove redundant url clones
They are now redundant since now document.url() returns a struct rather than a reference.
Diffstat (limited to 'components/script/webdriver_handlers.rs')
-rw-r--r--components/script/webdriver_handlers.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/components/script/webdriver_handlers.rs b/components/script/webdriver_handlers.rs
index a0de437d02f..e0818347c56 100644
--- a/components/script/webdriver_handlers.rs
+++ b/components/script/webdriver_handlers.rs
@@ -195,7 +195,7 @@ pub fn handle_get_cookies(documents: &Documents,
let url = document.url();
let (sender, receiver) = ipc::channel().unwrap();
let _ = document.window().upcast::<GlobalScope>().resource_threads().send(
- GetCookiesDataForUrl(url.clone(), sender, NonHTTP)
+ GetCookiesDataForUrl(url, sender, NonHTTP)
);
receiver.recv().unwrap()
},
@@ -215,7 +215,7 @@ pub fn handle_get_cookie(documents: &Documents,
let url = document.url();
let (sender, receiver) = ipc::channel().unwrap();
let _ = document.window().upcast::<GlobalScope>().resource_threads().send(
- GetCookiesDataForUrl(url.clone(), sender, NonHTTP)
+ GetCookiesDataForUrl(url, sender, NonHTTP)
);
receiver.recv().unwrap()
},
@@ -243,13 +243,13 @@ pub fn handle_add_cookie(documents: &Documents,
(true, _) => Err(WebDriverCookieError::InvalidDomain),
(false, Some(ref domain)) if url.host_str().map(|x| { x == &**domain }).unwrap_or(false) => {
let _ = document.window().upcast::<GlobalScope>().resource_threads().send(
- SetCookiesForUrlWithData(url.clone(), cookie, method)
+ SetCookiesForUrlWithData(url, cookie, method)
);
Ok(())
},
(false, None) => {
let _ = document.window().upcast::<GlobalScope>().resource_threads().send(
- SetCookiesForUrlWithData(url.clone(), cookie, method)
+ SetCookiesForUrlWithData(url, cookie, method)
);
Ok(())
},
@@ -364,7 +364,7 @@ pub fn handle_get_url(documents: &Documents,
reply: IpcSender<ServoUrl>) {
// TODO: Return an error if the pipeline doesn't exist.
let url = documents.find_document(pipeline)
- .map(|document| document.url().clone())
+ .map(|document| document.url())
.unwrap_or_else(|| ServoUrl::parse("about:blank").expect("infallible"));
reply.send(url).unwrap();
}