mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Cleanup code that was warned by rust-clippy
This commit is contained in:
parent
9c1cb9f61e
commit
81e034885b
9 changed files with 273 additions and 284 deletions
|
@ -113,13 +113,12 @@ impl BasicCORSCache {
|
|||
header_name: &str) -> Option<&'a mut CORSCacheEntry> {
|
||||
self.cleanup();
|
||||
let BasicCORSCache(ref mut buf) = *self;
|
||||
let entry = buf.iter_mut().find(|e| e.origin.scheme == request.origin.scheme &&
|
||||
e.origin.host() == request.origin.host() &&
|
||||
e.origin.port() == request.origin.port() &&
|
||||
e.url == request.destination &&
|
||||
e.credentials == request.credentials &&
|
||||
e.header_or_method.match_header(header_name));
|
||||
entry
|
||||
buf.iter_mut().find(|e| e.origin.scheme == request.origin.scheme &&
|
||||
e.origin.host() == request.origin.host() &&
|
||||
e.origin.port() == request.origin.port() &&
|
||||
e.url == request.destination &&
|
||||
e.credentials == request.credentials &&
|
||||
e.header_or_method.match_header(header_name))
|
||||
}
|
||||
|
||||
fn find_entry_by_method<'a>(&'a mut self, request: &CacheRequestDetails,
|
||||
|
@ -127,13 +126,12 @@ impl BasicCORSCache {
|
|||
// we can take the method from CORSRequest itself
|
||||
self.cleanup();
|
||||
let BasicCORSCache(ref mut buf) = *self;
|
||||
let entry = buf.iter_mut().find(|e| e.origin.scheme == request.origin.scheme &&
|
||||
e.origin.host() == request.origin.host() &&
|
||||
e.origin.port() == request.origin.port() &&
|
||||
e.url == request.destination &&
|
||||
e.credentials == request.credentials &&
|
||||
e.header_or_method.match_method(&method));
|
||||
entry
|
||||
buf.iter_mut().find(|e| e.origin.scheme == request.origin.scheme &&
|
||||
e.origin.host() == request.origin.host() &&
|
||||
e.origin.port() == request.origin.port() &&
|
||||
e.url == request.destination &&
|
||||
e.credentials == request.credentials &&
|
||||
e.header_or_method.match_method(&method))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue