@@ -237,6 +237,7 @@ impl<'a> Reader<&'a [u8]> {
237
237
/// that will be borrowed by events. This implementation provides a zero-copy deserialization
238
238
impl < ' a > XmlSource < ' a , ( ) > for & ' a [ u8 ] {
239
239
#[ cfg( not( feature = "encoding" ) ) ]
240
+ #[ inline]
240
241
fn remove_utf8_bom ( & mut self ) -> Result < ( ) > {
241
242
if self . starts_with ( crate :: encoding:: UTF8_BOM ) {
242
243
* self = & self [ crate :: encoding:: UTF8_BOM . len ( ) ..] ;
@@ -245,6 +246,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
245
246
}
246
247
247
248
#[ cfg( feature = "encoding" ) ]
249
+ #[ inline]
248
250
fn detect_encoding ( & mut self ) -> Result < Option < & ' static Encoding > > {
249
251
if let Some ( ( enc, bom_len) ) = crate :: encoding:: detect_encoding ( self ) {
250
252
* self = & self [ bom_len..] ;
@@ -253,6 +255,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
253
255
Ok ( None )
254
256
}
255
257
258
+ #[ inline]
256
259
fn read_bytes_until (
257
260
& mut self ,
258
261
byte : u8 ,
@@ -275,6 +278,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
275
278
}
276
279
}
277
280
281
+ #[ inline]
278
282
fn read_with < P : Parser > ( & mut self , _buf : ( ) , position : & mut usize ) -> Result < & ' a [ u8 ] > {
279
283
let mut parser = P :: default ( ) ;
280
284
@@ -290,6 +294,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
290
294
Err ( Error :: Syntax ( P :: eof_error ( ) ) )
291
295
}
292
296
297
+ #[ inline]
293
298
fn read_bang_element (
294
299
& mut self ,
295
300
_buf : ( ) ,
@@ -311,6 +316,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
311
316
Err ( bang_type. to_err ( ) )
312
317
}
313
318
319
+ #[ inline]
314
320
fn skip_whitespace ( & mut self , position : & mut usize ) -> Result < ( ) > {
315
321
let whitespaces = self
316
322
. iter ( )
@@ -321,6 +327,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
321
327
Ok ( ( ) )
322
328
}
323
329
330
+ #[ inline]
324
331
fn skip_one ( & mut self , byte : u8 ) -> Result < bool > {
325
332
// search byte must be within the ascii range
326
333
debug_assert ! ( byte. is_ascii( ) ) ;
@@ -332,6 +339,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
332
339
}
333
340
}
334
341
342
+ #[ inline]
335
343
fn peek_one ( & mut self ) -> Result < Option < u8 > > {
336
344
Ok ( self . first ( ) . copied ( ) )
337
345
}
0 commit comments