mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a
This commit is contained in:
parent
26045d7fcb
commit
d1b433a3b3
160 changed files with 1427 additions and 1162 deletions
|
@ -12,7 +12,8 @@ use image_cache_task::{Decode, GetImage, ImageCacheTask, ImageFailed, ImageNotRe
|
|||
use image_cache_task::{ImageResponseMsg, Prefetch, WaitForImage};
|
||||
|
||||
use std::comm::{Receiver, channel};
|
||||
use std::collections::hashmap::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::hash_map::{Occupied, Vacant};
|
||||
use servo_util::task::spawn_named;
|
||||
use url::Url;
|
||||
|
||||
|
@ -153,15 +154,15 @@ impl<NodeAddress: Send> LocalImageCache<NodeAddress> {
|
|||
}
|
||||
|
||||
fn get_state<'a>(&'a mut self, url: &Url) -> &'a mut ImageState {
|
||||
let state = self.state_map.find_or_insert_with(url.clone(), |_| {
|
||||
let new_state = ImageState {
|
||||
prefetched: false,
|
||||
decoded: false,
|
||||
last_request_round: 0,
|
||||
last_response: ImageNotReady
|
||||
};
|
||||
new_state
|
||||
});
|
||||
state
|
||||
match self.state_map.entry((*url).clone()) {
|
||||
Occupied(entry) => entry.into_mut(),
|
||||
Vacant(entry) =>
|
||||
entry.set(ImageState {
|
||||
prefetched: false,
|
||||
decoded: false,
|
||||
last_request_round: 0,
|
||||
last_response: ImageNotReady,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue