File tree Expand file tree Collapse file tree 9 files changed +18
-18
lines changed Expand file tree Collapse file tree 9 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -244,14 +244,14 @@ impl CharRefTokenizer {
244
244
245
245
let ( c, error) = match self . num {
246
246
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 ) ,
248
248
249
- 0x80 ... 0x9F => match data:: C1_REPLACEMENTS [ ( self . num - 0x80 ) as usize ] {
249
+ 0x80 ..= 0x9F => match data:: C1_REPLACEMENTS [ ( self . num - 0x80 ) as usize ] {
250
250
Some ( c) => ( c, true ) ,
251
251
None => ( conv ( self . num ) , true ) ,
252
252
} ,
253
253
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 ) ,
255
255
256
256
n if ( n & 0xFFFE ) == 0xFFFE => ( conv ( n) , true ) ,
257
257
Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ impl<Sink: TokenSink> Tokenizer<Sink> {
264
264
265
265
if self . opts . exact_errors &&
266
266
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 ,
268
268
n if ( n & 0xFFFE ) == 0xFFFE => true ,
269
269
_ => false ,
270
270
}
Original file line number Diff line number Diff line change @@ -19,15 +19,15 @@ pub fn to_escaped_string<T: fmt::Debug>(x: &T) -> String {
19
19
/// letter, otherwise None.
20
20
pub fn lower_ascii_letter ( c : char ) -> Option < char > {
21
21
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 ) ,
24
24
_ => None ,
25
25
}
26
26
}
27
27
28
28
/// Is the character an ASCII alphanumeric character?
29
29
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' )
31
31
}
32
32
33
33
/// ASCII whitespace characters, as defined by
Original file line number Diff line number Diff line change @@ -188,15 +188,15 @@ fn make_test_desc_with_scripting_flag(
188
188
) -> TestDescAndFn {
189
189
let get_field = |key| {
190
190
let field = fields. get ( key) . expect ( "missing field" ) ;
191
- field. trim_right_matches ( '\n' ) . to_string ( )
191
+ field. trim_end_matches ( '\n' ) . to_string ( )
192
192
} ;
193
193
194
194
let mut data = fields. get ( "data" ) . expect ( "missing data" ) . to_string ( ) ;
195
195
data. pop ( ) ;
196
196
let expected = get_field ( "document" ) ;
197
197
let context = fields
198
198
. get ( "document-fragment" )
199
- . map ( |field| context_name ( field. trim_right_matches ( '\n' ) ) ) ;
199
+ . map ( |field| context_name ( field. trim_end_matches ( '\n' ) ) ) ;
200
200
let ignore = ignores. contains ( name) ;
201
201
let mut name = name. to_owned ( ) ;
202
202
if scripting_enabled {
@@ -293,7 +293,7 @@ fn main() {
293
293
let f = fs:: File :: open ( & src_dir. join ( "data/test/ignore" ) ) . unwrap ( ) ;
294
294
let r = io:: BufReader :: new ( f) ;
295
295
for ln in r. lines ( ) {
296
- ignores. insert ( ln. unwrap ( ) . trim_right ( ) . to_string ( ) ) ;
296
+ ignores. insert ( ln. unwrap ( ) . trim_end ( ) . to_string ( ) ) ;
297
297
}
298
298
}
299
299
Original file line number Diff line number Diff line change @@ -243,14 +243,14 @@ impl CharRefTokenizer {
243
243
244
244
let ( c, error) = match self . num {
245
245
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 ) ,
247
247
248
- 0x80 ... 0x9F => match data:: C1_REPLACEMENTS [ ( self . num - 0x80 ) as usize ] {
248
+ 0x80 ..= 0x9F => match data:: C1_REPLACEMENTS [ ( self . num - 0x80 ) as usize ] {
249
249
Some ( c) => ( c, true ) ,
250
250
None => ( conv ( self . num ) , true ) ,
251
251
} ,
252
252
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 ) ,
254
254
255
255
n if ( n & 0xFFFE ) == 0xFFFE => ( conv ( n) , true ) ,
256
256
Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ impl<Sink: TokenSink> XmlTokenizer<Sink> {
247
247
// Exclude forbidden Unicode characters
248
248
if self . opts . exact_errors &&
249
249
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 ,
251
251
n if ( n & 0xFFFE ) == 0xFFFE => true ,
252
252
_ => false ,
253
253
}
Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ where
240
240
241
241
/// Call the `Tracer`'s `trace_handle` method on every `Handle` in the tree builder's
242
242
/// 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 > ) {
244
244
tracer. trace_handle ( & self . doc_handle ) ;
245
245
for e in self . open_elems . iter ( ) {
246
246
tracer. trace_handle ( & e) ;
Original file line number Diff line number Diff line change 9
9
10
10
/// Is the character an ASCII alphanumeric character?
11
11
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' )
13
13
}
14
14
15
15
#[ cfg( test) ]
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ fn make_xml_test(
180
180
) {
181
181
let get_field = |key| {
182
182
let field = fields. get ( key) . expect ( "missing field" ) ;
183
- field. trim_right_matches ( '\n' ) . to_string ( )
183
+ field. trim_end_matches ( '\n' ) . to_string ( )
184
184
} ;
185
185
186
186
let data = get_field ( "data" ) ;
@@ -249,7 +249,7 @@ fn run() {
249
249
if let Ok ( f) = fs:: File :: open ( & src_dir. join ( "data/test/ignore" ) ) {
250
250
let r = io:: BufReader :: new ( f) ;
251
251
for ln in r. lines ( ) {
252
- ignores. insert ( ln. unwrap ( ) . trim_right ( ) . to_string ( ) ) ;
252
+ ignores. insert ( ln. unwrap ( ) . trim_end ( ) . to_string ( ) ) ;
253
253
}
254
254
}
255
255
You can’t perform that action at this time.
0 commit comments