@@ -237,6 +237,7 @@ impl<'a> Reader<&'a [u8]> {
237237/// that will be borrowed by events. This implementation provides a zero-copy deserialization
238238impl < ' a > XmlSource < ' a , ( ) > for & ' a [ u8 ] {
239239 #[ cfg( not( feature = "encoding" ) ) ]
240+ #[ inline]
240241 fn remove_utf8_bom ( & mut self ) -> Result < ( ) > {
241242 if self . starts_with ( crate :: encoding:: UTF8_BOM ) {
242243 * self = & self [ crate :: encoding:: UTF8_BOM . len ( ) ..] ;
@@ -245,6 +246,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
245246 }
246247
247248 #[ cfg( feature = "encoding" ) ]
249+ #[ inline]
248250 fn detect_encoding ( & mut self ) -> Result < Option < & ' static Encoding > > {
249251 if let Some ( ( enc, bom_len) ) = crate :: encoding:: detect_encoding ( self ) {
250252 * self = & self [ bom_len..] ;
@@ -253,6 +255,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
253255 Ok ( None )
254256 }
255257
258+ #[ inline]
256259 fn read_bytes_until (
257260 & mut self ,
258261 byte : u8 ,
@@ -275,6 +278,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
275278 }
276279 }
277280
281+ #[ inline]
278282 fn read_with < P : Parser > ( & mut self , _buf : ( ) , position : & mut usize ) -> Result < & ' a [ u8 ] > {
279283 let mut parser = P :: default ( ) ;
280284
@@ -290,6 +294,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
290294 Err ( Error :: Syntax ( P :: eof_error ( ) ) )
291295 }
292296
297+ #[ inline]
293298 fn read_bang_element (
294299 & mut self ,
295300 _buf : ( ) ,
@@ -311,6 +316,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
311316 Err ( bang_type. to_err ( ) )
312317 }
313318
319+ #[ inline]
314320 fn skip_whitespace ( & mut self , position : & mut usize ) -> Result < ( ) > {
315321 let whitespaces = self
316322 . iter ( )
@@ -321,6 +327,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
321327 Ok ( ( ) )
322328 }
323329
330+ #[ inline]
324331 fn skip_one ( & mut self , byte : u8 ) -> Result < bool > {
325332 // search byte must be within the ascii range
326333 debug_assert ! ( byte. is_ascii( ) ) ;
@@ -332,6 +339,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
332339 }
333340 }
334341
342+ #[ inline]
335343 fn peek_one ( & mut self ) -> Result < Option < u8 > > {
336344 Ok ( self . first ( ) . copied ( ) )
337345 }
0 commit comments