Remove redundant .clone()s

This commit is contained in:
Shotaro Yamada 2018-12-11 10:43:51 +09:00
parent eeaca0b26d
commit c44a2febe6
19 changed files with 31 additions and 35 deletions

View file

@ -191,7 +191,7 @@ pub fn main_fetch(
},
Referrer::ReferrerUrl(url) => {
request.headers.remove(header::REFERER);
let current_url = request.current_url().clone();
let current_url = request.current_url();
determine_request_referrer(
&mut request.headers,
request.referrer_policy.unwrap(),

View file

@ -681,7 +681,7 @@ impl FileManagerStore {
self.insert(
id,
FileStoreEntry {
origin: origin.clone(),
origin,
file_impl: FileImpl::Memory(blob_buf),
refs: AtomicUsize::new(1),
is_valid_url: AtomicBool::new(set_valid),

View file

@ -40,7 +40,7 @@ pub struct CacheKey {
impl CacheKey {
fn new(request: Request) -> CacheKey {
CacheKey {
url: request.current_url().clone(),
url: request.current_url(),
}
}

View file

@ -1254,8 +1254,8 @@ fn http_network_fetch(
};
let devtools_sender = context.devtools_chan.clone();
let meta_status = meta.status.clone();
let meta_headers = meta.headers.clone();
let meta_status = meta.status;
let meta_headers = meta.headers;
let cancellation_listener = context.cancellation_listener.clone();
if cancellation_listener.lock().unwrap().cancelled() {
return Response::network_error(NetworkError::Internal("Fetch aborted".into()));
@ -1281,7 +1281,6 @@ fn http_network_fetch(
}
}
let done_sender = done_sender.clone();
let done_sender2 = done_sender.clone();
HANDLE.lock().unwrap().spawn(
res.into_body()

View file

@ -183,7 +183,7 @@ pub fn init(
.name(format!("WebSocket connection to {}", req_init.url))
.spawn(move || {
let protocols = match req_init.mode {
RequestMode::WebSocket { protocols } => protocols.clone(),
RequestMode::WebSocket { protocols } => protocols,
_ => panic!("Received a RequestInit with a non-websocket mode in websocket_loader"),
};