mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Eliminate warnings
This commit is contained in:
parent
2f46b9aede
commit
dc86e83654
57 changed files with 223 additions and 221 deletions
|
@ -63,7 +63,7 @@ fn load(load_data: LoadData, start_chan: Sender<LoadResponse>) {
|
|||
if is_base64 {
|
||||
// FIXME(#2909): It’s unclear what to do with non-alphabet characters,
|
||||
// but Acid 3 apparently depends on spaces being ignored.
|
||||
let bytes = bytes.move_iter().filter(|&b| b != ' ' as u8).collect::<Vec<u8>>();
|
||||
let bytes = bytes.into_iter().filter(|&b| b != ' ' as u8).collect::<Vec<u8>>();
|
||||
match bytes.as_slice().from_base64() {
|
||||
Err(..) => {
|
||||
progress_chan.send(Done(Err("non-base64 data uri".to_string())));
|
||||
|
|
|
@ -108,7 +108,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 entry = buf.mut_iter().find(|e| e.origin.scheme == request.origin.scheme &&
|
||||
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 &&
|
||||
|
@ -121,7 +121,7 @@ impl BasicCORSCache {
|
|||
// we can take the method from CORSRequest itself
|
||||
self.cleanup();
|
||||
let BasicCORSCache(ref mut buf) = *self;
|
||||
let entry = buf.mut_iter().find(|e| e.origin.scheme == request.origin.scheme &&
|
||||
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 &&
|
||||
|
@ -136,7 +136,7 @@ impl CORSCache for BasicCORSCache {
|
|||
#[allow(dead_code)]
|
||||
fn clear (&mut self, request: CacheRequestDetails) {
|
||||
let BasicCORSCache(buf) = self.clone();
|
||||
let new_buf: Vec<CORSCacheEntry> = buf.move_iter().filter(|e| e.origin == request.origin && request.destination == e.url).collect();
|
||||
let new_buf: Vec<CORSCacheEntry> = buf.into_iter().filter(|e| e.origin == request.origin && request.destination == e.url).collect();
|
||||
*self = BasicCORSCache(new_buf);
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ impl CORSCache for BasicCORSCache {
|
|||
fn cleanup(&mut self) {
|
||||
let BasicCORSCache(buf) = self.clone();
|
||||
let now = time::now().to_timespec();
|
||||
let new_buf: Vec<CORSCacheEntry> = buf.move_iter().filter(|e| now.sec > e.created.sec + e.max_age as i64).collect();
|
||||
let new_buf: Vec<CORSCacheEntry> = buf.into_iter().filter(|e| now.sec > e.created.sec + e.max_age as i64).collect();
|
||||
*self = BasicCORSCache(new_buf);
|
||||
}
|
||||
|
||||
|
|
|
@ -464,7 +464,7 @@ fn load_image_data(url: Url, resource_task: ResourceTask) -> Result<Vec<u8>, ()>
|
|||
image_data.push_all(data.as_slice());
|
||||
}
|
||||
resource_task::Done(result::Ok(..)) => {
|
||||
return Ok(image_data.move_iter().collect());
|
||||
return Ok(image_data.into_iter().collect());
|
||||
}
|
||||
resource_task::Done(result::Err(..)) => {
|
||||
return Err(());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue