Skip to content

Commit 843eac5

Browse files
author
bors-servo
authored
Auto merge of #380 - est31:no_more_deprecation_warnings, r=jdm
No more deprecation warnings CI is failing right now in my other PR #379 on beta and nightly because of deprecation warnings and a deny warnings directive. This PR fixes all deprecation warnings that rustc 1.37.0 beta is reporting.
2 parents 284953e + 02bf461 commit 843eac5

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

html5ever/src/tokenizer/char_ref/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,14 @@ impl CharRefTokenizer {
244244

245245
let (c, error) = match self.num {
246246
n if (n > 0x10FFFF) || self.num_too_big => ('\u{fffd}', true),
247-
0x00 | 0xD800...0xDFFF => ('\u{fffd}', true),
247+
0x00 | 0xD800..=0xDFFF => ('\u{fffd}', true),
248248

249-
0x80...0x9F => match data::C1_REPLACEMENTS[(self.num - 0x80) as usize] {
249+
0x80..=0x9F => match data::C1_REPLACEMENTS[(self.num - 0x80) as usize] {
250250
Some(c) => (c, true),
251251
None => (conv(self.num), true),
252252
},
253253

254-
0x01...0x08 | 0x0B | 0x0D...0x1F | 0x7F | 0xFDD0...0xFDEF => (conv(self.num), true),
254+
0x01..=0x08 | 0x0B | 0x0D..=0x1F | 0x7F | 0xFDD0..=0xFDEF => (conv(self.num), true),
255255

256256
n if (n & 0xFFFE) == 0xFFFE => (conv(n), true),
257257

html5ever/src/tokenizer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl<Sink: TokenSink> Tokenizer<Sink> {
264264

265265
if self.opts.exact_errors &&
266266
match c as u32 {
267-
0x01...0x08 | 0x0B | 0x0E...0x1F | 0x7F...0x9F | 0xFDD0...0xFDEF => true,
267+
0x01..=0x08 | 0x0B | 0x0E..=0x1F | 0x7F..=0x9F | 0xFDD0..=0xFDEF => true,
268268
n if (n & 0xFFFE) == 0xFFFE => true,
269269
_ => false,
270270
}

html5ever/src/util/str.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ pub fn to_escaped_string<T: fmt::Debug>(x: &T) -> String {
1919
/// letter, otherwise None.
2020
pub fn lower_ascii_letter(c: char) -> Option<char> {
2121
match c {
22-
'a'...'z' => Some(c),
23-
'A'...'Z' => Some((c as u8 - b'A' + b'a') as char),
22+
'a'..='z' => Some(c),
23+
'A'..='Z' => Some((c as u8 - b'A' + b'a') as char),
2424
_ => None,
2525
}
2626
}
2727

2828
/// Is the character an ASCII alphanumeric character?
2929
pub fn is_ascii_alnum(c: char) -> bool {
30-
matches!(c, '0'...'9' | 'a'...'z' | 'A'...'Z')
30+
matches!(c, '0'..='9' | 'a'..='z' | 'A'..='Z')
3131
}
3232

3333
/// ASCII whitespace characters, as defined by

html5ever/tests/tree_builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,15 @@ fn make_test_desc_with_scripting_flag(
188188
) -> TestDescAndFn {
189189
let get_field = |key| {
190190
let field = fields.get(key).expect("missing field");
191-
field.trim_right_matches('\n').to_string()
191+
field.trim_end_matches('\n').to_string()
192192
};
193193

194194
let mut data = fields.get("data").expect("missing data").to_string();
195195
data.pop();
196196
let expected = get_field("document");
197197
let context = fields
198198
.get("document-fragment")
199-
.map(|field| context_name(field.trim_right_matches('\n')));
199+
.map(|field| context_name(field.trim_end_matches('\n')));
200200
let ignore = ignores.contains(name);
201201
let mut name = name.to_owned();
202202
if scripting_enabled {
@@ -293,7 +293,7 @@ fn main() {
293293
let f = fs::File::open(&src_dir.join("data/test/ignore")).unwrap();
294294
let r = io::BufReader::new(f);
295295
for ln in r.lines() {
296-
ignores.insert(ln.unwrap().trim_right().to_string());
296+
ignores.insert(ln.unwrap().trim_end().to_string());
297297
}
298298
}
299299

xml5ever/src/tokenizer/char_ref/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,14 @@ impl CharRefTokenizer {
243243

244244
let (c, error) = match self.num {
245245
n if (n > 0x10FFFF) || self.num_too_big => ('\u{fffd}', true),
246-
0x00 | 0xD800...0xDFFF => ('\u{fffd}', true),
246+
0x00 | 0xD800..=0xDFFF => ('\u{fffd}', true),
247247

248-
0x80...0x9F => match data::C1_REPLACEMENTS[(self.num - 0x80) as usize] {
248+
0x80..=0x9F => match data::C1_REPLACEMENTS[(self.num - 0x80) as usize] {
249249
Some(c) => (c, true),
250250
None => (conv(self.num), true),
251251
},
252252

253-
0x01...0x08 | 0x0B | 0x0D...0x1F | 0x7F | 0xFDD0...0xFDEF => (conv(self.num), true),
253+
0x01..=0x08 | 0x0B | 0x0D..=0x1F | 0x7F | 0xFDD0..=0xFDEF => (conv(self.num), true),
254254

255255
n if (n & 0xFFFE) == 0xFFFE => (conv(n), true),
256256

xml5ever/src/tokenizer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl<Sink: TokenSink> XmlTokenizer<Sink> {
247247
// Exclude forbidden Unicode characters
248248
if self.opts.exact_errors &&
249249
match c as u32 {
250-
0x01...0x08 | 0x0B | 0x0E...0x1F | 0x7F...0x9F | 0xFDD0...0xFDEF => true,
250+
0x01..=0x08 | 0x0B | 0x0E..=0x1F | 0x7F..=0x9F | 0xFDD0..=0xFDEF => true,
251251
n if (n & 0xFFFE) == 0xFFFE => true,
252252
_ => false,
253253
}

xml5ever/src/tree_builder/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ where
240240

241241
/// Call the `Tracer`'s `trace_handle` method on every `Handle` in the tree builder's
242242
/// internal state. This is intended to support garbage-collected DOMs.
243-
pub fn trace_handles(&self, tracer: &Tracer<Handle = Handle>) {
243+
pub fn trace_handles(&self, tracer: &dyn Tracer<Handle = Handle>) {
244244
tracer.trace_handle(&self.doc_handle);
245245
for e in self.open_elems.iter() {
246246
tracer.trace_handle(&e);

xml5ever/src/util/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
/// Is the character an ASCII alphanumeric character?
1111
pub fn is_ascii_alnum(c: char) -> bool {
12-
matches!(c, '0'...'9' | 'a'...'z' | 'A'...'Z')
12+
matches!(c, '0'..='9' | 'a'..='z' | 'A'..='Z')
1313
}
1414

1515
#[cfg(test)]

xml5ever/tests/tree_builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ fn make_xml_test(
180180
) {
181181
let get_field = |key| {
182182
let field = fields.get(key).expect("missing field");
183-
field.trim_right_matches('\n').to_string()
183+
field.trim_end_matches('\n').to_string()
184184
};
185185

186186
let data = get_field("data");
@@ -249,7 +249,7 @@ fn run() {
249249
if let Ok(f) = fs::File::open(&src_dir.join("data/test/ignore")) {
250250
let r = io::BufReader::new(f);
251251
for ln in r.lines() {
252-
ignores.insert(ln.unwrap().trim_right().to_string());
252+
ignores.insert(ln.unwrap().trim_end().to_string());
253253
}
254254
}
255255

0 commit comments

Comments
 (0)