diff options
author | Pu Xingyu <pu.stshine@gmail.com> | 2016-11-18 12:39:22 +0800 |
---|---|---|
committer | Pu Xingyu <pu.stshine@gmail.com> | 2016-11-18 12:39:22 +0800 |
commit | 91f3d4f4749a1dd53d665f741be85559b820cbe7 (patch) | |
tree | 0170b480610acde6aa39867bdf581c4d6d352022 /components/script/webdriver_handlers.rs | |
parent | fb6cc15208690acb4c66445b71f2ff8d1dcfcf73 (diff) | |
download | servo-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.rs | 10 |
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(); } |