use self.0 instead of destructing single item tuple structs

This commit is contained in:
faineance 2016-03-27 11:50:08 +01:00
parent 68a8085a2f
commit 418842faf9
17 changed files with 38 additions and 58 deletions

View file

@ -394,7 +394,7 @@ impl CORSCache {
header_name: &str)
-> Option<&'a mut CORSCacheEntry> {
self.cleanup();
let CORSCache(ref mut buf) = *self;
let ref mut buf = self.0;
// Credentials are not yet implemented here
buf.iter_mut().find(|e| {
e.origin.scheme == request.origin.scheme && e.origin.host() == request.origin.host() &&
@ -421,7 +421,7 @@ impl CORSCache {
-> Option<&'a mut CORSCacheEntry> {
// we can take the method from CORSRequest itself
self.cleanup();
let CORSCache(ref mut buf) = *self;
let ref mut buf = self.0;
// Credentials are not yet implemented here
buf.iter_mut().find(|e| {
e.origin.scheme == request.origin.scheme && e.origin.host() == request.origin.host() &&
@ -445,8 +445,7 @@ impl CORSCache {
fn insert(&mut self, entry: CORSCacheEntry) {
self.cleanup();
let CORSCache(ref mut buf) = *self;
buf.push(entry);
self.0.push(entry);
}
}