diff --git a/components/net/fetch/cors_cache.rs b/components/net/fetch/cors_cache.rs index 5a36026fdc3..32d2615c747 100644 --- a/components/net/fetch/cors_cache.rs +++ b/components/net/fetch/cors_cache.rs @@ -46,14 +46,14 @@ impl HeaderOrMethod { pub struct CORSCacheEntry { pub origin: Url, pub url: Url, - pub max_age: uint, + pub max_age: u32, pub credentials: bool, pub header_or_method: HeaderOrMethod, created: Timespec } impl CORSCacheEntry { - fn new (origin:Url, url: Url, max_age: uint, credentials: bool, header_or_method: HeaderOrMethod) -> CORSCacheEntry { + fn new (origin:Url, url: Url, max_age: u32, credentials: bool, header_or_method: HeaderOrMethod) -> CORSCacheEntry { CORSCacheEntry { origin: origin, url: url, @@ -86,7 +86,7 @@ pub trait CORSCache { /// Updates max age if an entry for a [matching header](http://fetch.spec.whatwg.org/#concept-cache-match-header) is found. /// /// If not, it will insert an equivalent entry - fn match_header_and_update(&mut self, request: CacheRequestDetails, header_name: &str, new_max_age: uint) -> bool; + fn match_header_and_update(&mut self, request: CacheRequestDetails, header_name: &str, new_max_age: u32) -> bool; /// Returns true if an entry with a [matching method](http://fetch.spec.whatwg.org/#concept-cache-match-method) is found fn match_method(&mut self, request: CacheRequestDetails, method: Method) -> bool; @@ -94,7 +94,7 @@ pub trait CORSCache { /// Updates max age if an entry for [a matching method](http://fetch.spec.whatwg.org/#concept-cache-match-method) is found. /// /// If not, it will insert an equivalent entry - fn match_method_and_update(&mut self, request: CacheRequestDetails, method: Method, new_max_age: uint) -> bool; + fn match_method_and_update(&mut self, request: CacheRequestDetails, method: Method, new_max_age: u32) -> bool; /// Insert an entry fn insert(&mut self, entry: CORSCacheEntry); } @@ -152,7 +152,7 @@ impl CORSCache for BasicCORSCache { self.find_entry_by_header(&request, header_name).is_some() } - fn match_header_and_update(&mut self, request: CacheRequestDetails, header_name: &str, new_max_age: uint) -> bool { + fn match_header_and_update(&mut self, request: CacheRequestDetails, header_name: &str, new_max_age: u32) -> bool { match self.find_entry_by_header(&request, header_name).map(|e| e.max_age = new_max_age) { Some(_) => true, None => { @@ -167,7 +167,7 @@ impl CORSCache for BasicCORSCache { self.find_entry_by_method(&request, method).is_some() } - fn match_method_and_update(&mut self, request: CacheRequestDetails, method: Method, new_max_age: uint) -> bool { + fn match_method_and_update(&mut self, request: CacheRequestDetails, method: Method, new_max_age: u32) -> bool { match self.find_entry_by_method(&request, method.clone()).map(|e| e.max_age = new_max_age) { Some(_) => true, None => { @@ -190,9 +190,9 @@ pub enum CORSCacheTaskMsg { Clear(CacheRequestDetails, Sender<()>), Cleanup(Sender<()>), MatchHeader(CacheRequestDetails, String, Sender), - MatchHeaderUpdate(CacheRequestDetails, String, uint, Sender), + MatchHeaderUpdate(CacheRequestDetails, String, u32, Sender), MatchMethod(CacheRequestDetails, Method, Sender), - MatchMethodUpdate(CacheRequestDetails, Method, uint, Sender), + MatchMethodUpdate(CacheRequestDetails, Method, u32, Sender), Insert(CORSCacheEntry, Sender<()>), ExitMsg } @@ -222,7 +222,7 @@ impl CORSCache for CORSCacheSender { rx.recv().unwrap_or(false) } - fn match_header_and_update(&mut self, request: CacheRequestDetails, header_name: &str, new_max_age: uint) -> bool { + fn match_header_and_update(&mut self, request: CacheRequestDetails, header_name: &str, new_max_age: u32) -> bool { let (tx, rx) = channel(); self.send(CORSCacheTaskMsg::MatchHeaderUpdate(request, header_name.to_string(), new_max_age, tx)); rx.recv().unwrap_or(false) @@ -234,7 +234,7 @@ impl CORSCache for CORSCacheSender { rx.recv().unwrap_or(false) } - fn match_method_and_update(&mut self, request: CacheRequestDetails, method: Method, new_max_age: uint) -> bool { + fn match_method_and_update(&mut self, request: CacheRequestDetails, method: Method, new_max_age: u32) -> bool { let (tx, rx) = channel(); self.send(CORSCacheTaskMsg::MatchMethodUpdate(request, method, new_max_age, tx)); rx.recv().unwrap_or(false) diff --git a/components/net/fetch/request.rs b/components/net/fetch/request.rs index e7bb5914aaa..76e2e5557d3 100644 --- a/components/net/fetch/request.rs +++ b/components/net/fetch/request.rs @@ -84,7 +84,7 @@ pub struct Request { pub credentials_mode: CredentialsMode, pub use_url_credentials: bool, pub manual_redirect: bool, - pub redirect_count: uint, + pub redirect_count: u32, pub response_tainting: ResponseTainting, pub cache: Option> } diff --git a/components/net/file_loader.rs b/components/net/file_loader.rs index 83fcc7ed59f..49a451d2abb 100644 --- a/components/net/file_loader.rs +++ b/components/net/file_loader.rs @@ -15,7 +15,7 @@ use std::sync::Arc; use std::sync::mpsc::Sender; use util::task::spawn_named; -static READ_SIZE: uint = 8192; +static READ_SIZE: usize = 8192; enum ReadStatus { Partial(Vec), diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs index c59066293dd..16be70795a7 100644 --- a/components/net/http_loader.rs +++ b/components/net/http_loader.rs @@ -70,8 +70,8 @@ fn load(mut load_data: LoadData, classifier: Arc, cookies_chan: // FIXME: At the time of writing this FIXME, servo didn't have any central // location for configuration. If you're reading this and such a // repository DOES exist, please update this constant to use it. - let max_redirects = 50u; - let mut iters = 0u; + let max_redirects = 50; + let mut iters = 0; let start_chan = load_data.consumer; let mut url = load_data.url.clone(); let mut redirected_to = HashSet::new(); diff --git a/components/net/lib.rs b/components/net/lib.rs index bd2bd882570..d4e69232779 100644 --- a/components/net/lib.rs +++ b/components/net/lib.rs @@ -6,7 +6,6 @@ #![feature(box_syntax)] #![feature(collections)] #![feature(core)] -#![feature(int_uint)] #![feature(io)] #![cfg_attr(test, feature(net))] #![feature(path)] diff --git a/components/net/storage_task.rs b/components/net/storage_task.rs index 215d451a9ab..e6853aa75d0 100644 --- a/components/net/storage_task.rs +++ b/components/net/storage_task.rs @@ -86,17 +86,17 @@ impl StorageManager { } } - fn length(&self, sender: Sender, url: Url, storage_type: StorageType) { + fn length(&self, sender: Sender, url: Url, storage_type: StorageType) { let origin = self.get_origin_as_string(url); let data = self.select_data(storage_type); - sender.send(data.get(&origin).map_or(0u, |entry| entry.len()) as u32).unwrap(); + sender.send(data.get(&origin).map_or(0, |entry| entry.len())).unwrap(); } fn key(&self, sender: Sender>, url: Url, storage_type: StorageType, index: u32) { let origin = self.get_origin_as_string(url); let data = self.select_data(storage_type); sender.send(data.get(&origin) - .and_then(|entry| entry.keys().nth(index as uint)) + .and_then(|entry| entry.keys().nth(index as usize)) .map(|key| key.clone())).unwrap(); } diff --git a/components/net_traits/storage_task.rs b/components/net_traits/storage_task.rs index cedc98bf480..3a2cd204220 100644 --- a/components/net_traits/storage_task.rs +++ b/components/net_traits/storage_task.rs @@ -16,7 +16,7 @@ pub enum StorageType { /// Request operations on the storage data associated with a particular url pub enum StorageTaskMsg { /// gets the number of key/value pairs present in the associated storage data - Length(Sender, Url, StorageType), + Length(Sender, Url, StorageType), /// gets the name of the key at the specified index in the associated storage data Key(Sender>, Url, StorageType, u32), diff --git a/components/script/dom/storage.rs b/components/script/dom/storage.rs index 7868e53f21c..9ec49555c9c 100644 --- a/components/script/dom/storage.rs +++ b/components/script/dom/storage.rs @@ -63,7 +63,7 @@ impl<'a> StorageMethods for JSRef<'a, Storage> { let (sender, receiver) = channel(); self.get_storage_task().send(StorageTaskMsg::Length(sender, self.get_url(), self.storage_type)).unwrap(); - receiver.recv().unwrap() + receiver.recv().unwrap() as u32 } fn Key(self, index: u32) -> Option {