diff options
author | faineance <faineance@users.noreply.github.com> | 2016-03-27 11:50:08 +0100 |
---|---|---|
committer | faineance <faineance@users.noreply.github.com> | 2016-03-27 11:50:08 +0100 |
commit | 418842faf9135da4b70b12fd8b88bc6b8d504cfc (patch) | |
tree | 64690189fcf218696759273c2c29cc2799db8e25 /components/net/fetch | |
parent | 68a8085a2f11d052948145980a0bf8a46471e3a7 (diff) | |
download | servo-418842faf9135da4b70b12fd8b88bc6b8d504cfc.tar.gz servo-418842faf9135da4b70b12fd8b88bc6b8d504cfc.zip |
use self.0 instead of destructing single item tuple structs
Diffstat (limited to 'components/net/fetch')
-rw-r--r-- | components/net/fetch/cors_cache.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/components/net/fetch/cors_cache.rs b/components/net/fetch/cors_cache.rs index 63c62f37c23..27807e1e354 100644 --- a/components/net/fetch/cors_cache.rs +++ b/components/net/fetch/cors_cache.rs @@ -124,7 +124,7 @@ impl BasicCORSCache { fn find_entry_by_header<'a>(&'a mut self, request: &CacheRequestDetails, header_name: &str) -> Option<&'a mut CORSCacheEntry> { self.cleanup(); - let BasicCORSCache(ref mut buf) = *self; + let ref mut buf = self.0; buf.iter_mut().find(|e| match_headers(e, request) && e.header_or_method.match_header(header_name)) } @@ -132,7 +132,7 @@ impl BasicCORSCache { method: Method) -> Option<&'a mut CORSCacheEntry> { // we can take the method from CORSRequest itself self.cleanup(); - let BasicCORSCache(ref mut buf) = *self; + let ref mut buf = self.0; buf.iter_mut().find(|e| match_headers(e, request) && e.header_or_method.match_method(&method)) } } @@ -190,8 +190,7 @@ impl CORSCache for BasicCORSCache { fn insert(&mut self, entry: CORSCacheEntry) { self.cleanup(); - let BasicCORSCache(ref mut buf) = *self; - buf.push(entry); + self.0.push(entry); } } |