@@ -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 > ( & mut self , mut parser : P , _buf : ( ) , position : & mut usize ) -> Result < & ' a [ u8 ] >
279283 where
280284 P : Parser ,
@@ -291,6 +295,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
291295 Err ( Error :: Syntax ( P :: eof_error ( ) ) )
292296 }
293297
298+ #[ inline]
294299 fn read_bang_element (
295300 & mut self ,
296301 _buf : ( ) ,
@@ -312,6 +317,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
312317 Err ( bang_type. to_err ( ) )
313318 }
314319
320+ #[ inline]
315321 fn skip_whitespace ( & mut self , position : & mut usize ) -> Result < ( ) > {
316322 let whitespaces = self
317323 . iter ( )
@@ -322,6 +328,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
322328 Ok ( ( ) )
323329 }
324330
331+ #[ inline]
325332 fn skip_one ( & mut self , byte : u8 ) -> Result < bool > {
326333 // search byte must be within the ascii range
327334 debug_assert ! ( byte. is_ascii( ) ) ;
@@ -333,6 +340,7 @@ impl<'a> XmlSource<'a, ()> for &'a [u8] {
333340 }
334341 }
335342
343+ #[ inline]
336344 fn peek_one ( & mut self ) -> Result < Option < u8 > > {
337345 Ok ( self . first ( ) . copied ( ) )
338346 }
0 commit comments