aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2019-06-19 16:07:13 +0200
committerSimon Sapin <simon.sapin@exyr.org>2019-06-22 14:59:09 +0200
commit1d38bc041967b88838ed7b006aab9908e2f24474 (patch)
tree9ae175710524777f97a14a85e52dacfd71a5dedd /components/script/dom
parent112f1ddeba3d79c9e892986a9e550e4eef933b1f (diff)
downloadservo-1d38bc041967b88838ed7b006aab9908e2f24474.tar.gz
servo-1d38bc041967b88838ed7b006aab9908e2f24474.zip
Fix some new warnings
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/bindings/str.rs2
-rw-r--r--components/script/dom/bindings/xmlname.rs34
-rw-r--r--components/script/dom/dedicatedworkerglobalscope.rs4
-rw-r--r--components/script/dom/headers.rs4
-rw-r--r--components/script/dom/htmlareaelement.rs2
-rw-r--r--components/script/dom/htmlcollection.rs2
-rw-r--r--components/script/dom/htmlimageelement.rs2
-rw-r--r--components/script/dom/htmlmediaelement.rs4
-rw-r--r--components/script/dom/htmlscriptelement.rs2
-rw-r--r--components/script/dom/paintworkletglobalscope.rs2
-rw-r--r--components/script/dom/promisenativehandler.rs4
-rw-r--r--components/script/dom/rtcpeerconnection.rs2
-rw-r--r--components/script/dom/window.rs4
-rw-r--r--components/script/dom/xmlhttprequest.rs2
14 files changed, 35 insertions, 35 deletions
diff --git a/components/script/dom/bindings/str.rs b/components/script/dom/bindings/str.rs
index e08159bc1e2..ad4ce8bc621 100644
--- a/components/script/dom/bindings/str.rs
+++ b/components/script/dom/bindings/str.rs
@@ -140,7 +140,7 @@ pub fn is_token(s: &[u8]) -> bool {
s.iter().all(|&x| {
// http://tools.ietf.org/html/rfc2616#section-2.2
match x {
- 0...31 | 127 => false, // CTLs
+ 0..=31 | 127 => false, // CTLs
40 | 41 | 60 | 62 | 64 | 44 | 59 | 58 | 92 | 34 | 47 | 91 | 93 | 63 | 61 | 123 |
125 | 32 => false, // separators
x if x > 127 => false, // non-CHARs
diff --git a/components/script/dom/bindings/xmlname.rs b/components/script/dom/bindings/xmlname.rs
index ab1fe30c8a5..12c10620dd0 100644
--- a/components/script/dom/bindings/xmlname.rs
+++ b/components/script/dom/bindings/xmlname.rs
@@ -96,21 +96,21 @@ pub fn xml_name_type(name: &str) -> XMLName {
fn is_valid_start(c: char) -> bool {
match c {
':' |
- 'A'...'Z' |
+ 'A'..='Z' |
'_' |
- 'a'...'z' |
- '\u{C0}'...'\u{D6}' |
- '\u{D8}'...'\u{F6}' |
- '\u{F8}'...'\u{2FF}' |
- '\u{370}'...'\u{37D}' |
- '\u{37F}'...'\u{1FFF}' |
- '\u{200C}'...'\u{200D}' |
- '\u{2070}'...'\u{218F}' |
- '\u{2C00}'...'\u{2FEF}' |
- '\u{3001}'...'\u{D7FF}' |
- '\u{F900}'...'\u{FDCF}' |
- '\u{FDF0}'...'\u{FFFD}' |
- '\u{10000}'...'\u{EFFFF}' => true,
+ 'a'..='z' |
+ '\u{C0}'..='\u{D6}' |
+ '\u{D8}'..='\u{F6}' |
+ '\u{F8}'..='\u{2FF}' |
+ '\u{370}'..='\u{37D}' |
+ '\u{37F}'..='\u{1FFF}' |
+ '\u{200C}'..='\u{200D}' |
+ '\u{2070}'..='\u{218F}' |
+ '\u{2C00}'..='\u{2FEF}' |
+ '\u{3001}'..='\u{D7FF}' |
+ '\u{F900}'..='\u{FDCF}' |
+ '\u{FDF0}'..='\u{FFFD}' |
+ '\u{10000}'..='\u{EFFFF}' => true,
_ => false,
}
}
@@ -120,10 +120,10 @@ pub fn xml_name_type(name: &str) -> XMLName {
match c {
'-' |
'.' |
- '0'...'9' |
+ '0'..='9' |
'\u{B7}' |
- '\u{300}'...'\u{36F}' |
- '\u{203F}'...'\u{2040}' => true,
+ '\u{300}'..='\u{36F}' |
+ '\u{203F}'..='\u{2040}' => true,
_ => false,
}
}
diff --git a/components/script/dom/dedicatedworkerglobalscope.rs b/components/script/dom/dedicatedworkerglobalscope.rs
index 66691a557e1..c3f564e17ff 100644
--- a/components/script/dom/dedicatedworkerglobalscope.rs
+++ b/components/script/dom/dedicatedworkerglobalscope.rs
@@ -174,9 +174,9 @@ pub struct DedicatedWorkerGlobalScope {
worker: DomRefCell<Option<TrustedWorkerAddress>>,
#[ignore_malloc_size_of = "Can't measure trait objects"]
/// Sender to the parent thread.
- parent_sender: Box<ScriptChan + Send>,
+ parent_sender: Box<dyn ScriptChan + Send>,
#[ignore_malloc_size_of = "Arc"]
- image_cache: Arc<ImageCache>,
+ image_cache: Arc<dyn ImageCache>,
}
impl WorkerEventLoopMethods for DedicatedWorkerGlobalScope {
diff --git a/components/script/dom/headers.rs b/components/script/dom/headers.rs
index 98b24dd1979..2f2af810df8 100644
--- a/components/script/dom/headers.rs
+++ b/components/script/dom/headers.rs
@@ -499,7 +499,7 @@ fn is_field_vchar(x: u8) -> bool {
// https://tools.ietf.org/html/rfc5234#appendix-B.1
pub fn is_vchar(x: u8) -> bool {
match x {
- 0x21...0x7E => true,
+ 0x21..=0x7E => true,
_ => false,
}
}
@@ -507,7 +507,7 @@ pub fn is_vchar(x: u8) -> bool {
// http://tools.ietf.org/html/rfc7230#section-3.2.6
pub fn is_obs_text(x: u8) -> bool {
match x {
- 0x80...0xFF => true,
+ 0x80..=0xFF => true,
_ => false,
}
}
diff --git a/components/script/dom/htmlareaelement.rs b/components/script/dom/htmlareaelement.rs
index dfa84bb7ac4..2cbd4ed1e37 100644
--- a/components/script/dom/htmlareaelement.rs
+++ b/components/script/dom/htmlareaelement.rs
@@ -82,7 +82,7 @@ impl Area {
while index < size {
let val = num[index];
match val {
- b'0'...b'9' | b'.' | b'-' | b'E' | b'e' => break,
+ b'0'..=b'9' | b'.' | b'-' | b'E' | b'e' => break,
_ => {},
}
diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs
index 35561285909..6ad41be4652 100644
--- a/components/script/dom/htmlcollection.rs
+++ b/components/script/dom/htmlcollection.rs
@@ -57,7 +57,7 @@ pub struct HTMLCollection {
reflector_: Reflector,
root: Dom<Node>,
#[ignore_malloc_size_of = "Contains a trait object; can't measure due to #6870"]
- filter: Box<CollectionFilter + 'static>,
+ filter: Box<dyn CollectionFilter + 'static>,
// We cache the version of the root node and all its decendents,
// the length of the collection, and a cursor into the collection.
// FIXME: make the cached cursor element a weak pointer
diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs
index 62a369579a1..4a9a94dccde 100644
--- a/components/script/dom/htmlimageelement.rs
+++ b/components/script/dom/htmlimageelement.rs
@@ -210,7 +210,7 @@ impl FetchResponseListener for ImageContext {
0 => Err(NetworkError::Internal(
"No http status code received".to_owned(),
)),
- 200...299 => Ok(()), // HTTP ok status codes
+ 200..=299 => Ok(()), // HTTP ok status codes
_ => Err(NetworkError::Internal(format!(
"HTTP error code {}",
status_code
diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs
index f39166657c5..690dd928f45 100644
--- a/components/script/dom/htmlmediaelement.rs
+++ b/components/script/dom/htmlmediaelement.rs
@@ -227,7 +227,7 @@ pub struct HTMLMediaElement {
#[ignore_malloc_size_of = "promises are hard"]
in_flight_play_promises_queue: DomRefCell<VecDeque<(Box<[Rc<Promise>]>, ErrorResult)>>,
#[ignore_malloc_size_of = "servo_media"]
- player: DomRefCell<Option<Box<Player>>>,
+ player: DomRefCell<Option<Box<dyn Player>>>,
#[ignore_malloc_size_of = "Arc"]
frame_renderer: Arc<Mutex<MediaFrameRenderer>>,
/// https://html.spec.whatwg.org/multipage/#show-poster-flag
@@ -1223,7 +1223,7 @@ impl HTMLMediaElement {
};
let (action_sender, action_receiver) = ipc::channel().unwrap();
- let renderer: Option<Arc<Mutex<FrameRenderer>>> = match self.media_type_id() {
+ let renderer: Option<Arc<Mutex<dyn FrameRenderer>>> = match self.media_type_id() {
HTMLMediaElementTypeId::HTMLAudioElement => None,
HTMLMediaElementTypeId::HTMLVideoElement => Some(self.frame_renderer.clone()),
};
diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs
index 8d44c4b9ffd..369f43b6019 100644
--- a/components/script/dom/htmlscriptelement.rs
+++ b/components/script/dom/htmlscriptelement.rs
@@ -198,7 +198,7 @@ impl FetchResponseListener for ScriptContext {
0 => Err(NetworkError::Internal(
"No http status code received".to_owned(),
)),
- 200...299 => Ok(()), // HTTP ok status codes
+ 200..=299 => Ok(()), // HTTP ok status codes
_ => Err(NetworkError::Internal(format!(
"HTTP error code {}",
status_code
diff --git a/components/script/dom/paintworkletglobalscope.rs b/components/script/dom/paintworkletglobalscope.rs
index 36b57e266f9..7791456294d 100644
--- a/components/script/dom/paintworkletglobalscope.rs
+++ b/components/script/dom/paintworkletglobalscope.rs
@@ -72,7 +72,7 @@ pub struct PaintWorkletGlobalScope {
worklet_global: WorkletGlobalScope,
/// The image cache
#[ignore_malloc_size_of = "Arc"]
- image_cache: Arc<ImageCache>,
+ image_cache: Arc<dyn ImageCache>,
/// <https://drafts.css-houdini.org/css-paint-api/#paint-definitions>
paint_definitions: DomRefCell<HashMap<Atom, Box<PaintDefinition>>>,
/// <https://drafts.css-houdini.org/css-paint-api/#paint-class-instances>
diff --git a/components/script/dom/promisenativehandler.rs b/components/script/dom/promisenativehandler.rs
index 85f08d776e5..147aad57fd5 100644
--- a/components/script/dom/promisenativehandler.rs
+++ b/components/script/dom/promisenativehandler.rs
@@ -19,8 +19,8 @@ pub trait Callback: JSTraceable + MallocSizeOf {
#[dom_struct]
pub struct PromiseNativeHandler {
reflector: Reflector,
- resolve: Option<Box<Callback>>,
- reject: Option<Box<Callback>>,
+ resolve: Option<Box<dyn Callback>>,
+ reject: Option<Box<dyn Callback>>,
}
impl PromiseNativeHandler {
diff --git a/components/script/dom/rtcpeerconnection.rs b/components/script/dom/rtcpeerconnection.rs
index 2997698e309..9fbe4b8ce45 100644
--- a/components/script/dom/rtcpeerconnection.rs
+++ b/components/script/dom/rtcpeerconnection.rs
@@ -203,7 +203,7 @@ impl RTCPeerConnection {
Ok(RTCPeerConnection::new(&window.global(), config))
}
- fn make_signaller(&self) -> Box<WebRtcSignaller> {
+ fn make_signaller(&self) -> Box<dyn WebRtcSignaller> {
let trusted = Trusted::new(self);
let (task_source, canceller) = self
.global()
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index bb0e8198beb..ed87fa5e949 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -174,7 +174,7 @@ pub struct Window {
task_manager: TaskManager,
navigator: MutNullableDom<Navigator>,
#[ignore_malloc_size_of = "Arc"]
- image_cache: Arc<ImageCache>,
+ image_cache: Arc<dyn ImageCache>,
#[ignore_malloc_size_of = "channels are hard"]
image_cache_chan: Sender<ImageCacheMsg>,
window_proxy: MutNullableDom<WindowProxy>,
@@ -215,7 +215,7 @@ pub struct Window {
/// A handle to perform RPC calls into the layout, quickly.
#[ignore_malloc_size_of = "trait objects are hard"]
- layout_rpc: Box<LayoutRPC + Send + 'static>,
+ layout_rpc: Box<dyn LayoutRPC + Send + 'static>,
/// The current size of the window, in pixels.
window_size: Cell<WindowSizeData>,
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs
index 583a179e43a..443a0711815 100644
--- a/components/script/dom/xmlhttprequest.rs
+++ b/components/script/dom/xmlhttprequest.rs
@@ -1668,7 +1668,7 @@ pub fn is_field_value(slice: &[u8]) -> bool {
false
}
},
- 0...31 | 127 => false, // CTLs
+ 0..=31 | 127 => false, // CTLs
x if x > 127 => false, // non ASCII
_ if prev == PreviousCharacter::Other || prev == PreviousCharacter::SPHT => {
prev = PreviousCharacter::Other;