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 {
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
Original file line number Diff line number Diff 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 }
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 {
1919/// letter, otherwise None.
2020pub 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?
2929pub 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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) ;
Original file line number Diff line number Diff line change 99
1010/// Is the character an ASCII alphanumeric character?
1111pub 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) ]
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments