@@ -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 > ( & mut self , mut parser : P , _buf : ( ) , position : & mut usize ) -> Result < & ' a [ u8 ] >
279
283
where
280
284
P : Parser ,
@@ -291,6 +295,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
291
295
Err ( Error :: Syntax ( P :: eof_error ( ) ) )
292
296
}
293
297
298
+ #[ inline]
294
299
fn read_bang_element (
295
300
& mut self ,
296
301
_buf : ( ) ,
@@ -312,6 +317,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
312
317
Err ( bang_type. to_err ( ) )
313
318
}
314
319
320
+ #[ inline]
315
321
fn skip_whitespace ( & mut self , position : & mut usize ) -> Result < ( ) > {
316
322
let whitespaces = self
317
323
. iter ( )
@@ -322,6 +328,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
322
328
Ok ( ( ) )
323
329
}
324
330
331
+ #[ inline]
325
332
fn skip_one ( & mut self , byte : u8 ) -> Result < bool > {
326
333
// search byte must be within the ascii range
327
334
debug_assert ! ( byte. is_ascii( ) ) ;
@@ -333,6 +340,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
333
340
}
334
341
}
335
342
343
+ #[ inline]
336
344
fn peek_one ( & mut self ) -> Result < Option < u8 > > {
337
345
Ok ( self . first ( ) . copied ( ) )
338
346
}
0 commit comments