@@ -179,74 +179,90 @@ macro_rules! read_sleb128 {
179179impl < ' a > serialize:: Decoder for Decoder < ' a > {
180180 type Error = String ;
181181
182+ #[ inline]
182183 fn read_nil ( & mut self ) -> Result < ( ) , Self :: Error > {
183184 Ok ( ( ) )
184185 }
185186
187+ #[ inline]
186188 fn read_u64 ( & mut self ) -> Result < u64 , Self :: Error > {
187189 read_uleb128 ! ( self , u64 )
188190 }
189191
192+ #[ inline]
190193 fn read_u32 ( & mut self ) -> Result < u32 , Self :: Error > {
191194 read_uleb128 ! ( self , u32 )
192195 }
193196
197+ #[ inline]
194198 fn read_u16 ( & mut self ) -> Result < u16 , Self :: Error > {
195199 read_uleb128 ! ( self , u16 )
196200 }
197201
202+ #[ inline]
198203 fn read_u8 ( & mut self ) -> Result < u8 , Self :: Error > {
199204 let value = self . data [ self . position ] ;
200205 self . position += 1 ;
201206 Ok ( value)
202207 }
203208
209+ #[ inline]
204210 fn read_usize ( & mut self ) -> Result < usize , Self :: Error > {
205211 read_uleb128 ! ( self , usize )
206212 }
207213
214+ #[ inline]
208215 fn read_i64 ( & mut self ) -> Result < i64 , Self :: Error > {
209216 read_sleb128 ! ( self , i64 )
210217 }
211218
219+ #[ inline]
212220 fn read_i32 ( & mut self ) -> Result < i32 , Self :: Error > {
213221 read_sleb128 ! ( self , i32 )
214222 }
215223
224+ #[ inline]
216225 fn read_i16 ( & mut self ) -> Result < i16 , Self :: Error > {
217226 read_sleb128 ! ( self , i16 )
218227 }
219228
229+ #[ inline]
220230 fn read_i8 ( & mut self ) -> Result < i8 , Self :: Error > {
221231 let as_u8 = self . data [ self . position ] ;
222232 self . position += 1 ;
223233 unsafe { Ok ( :: std:: mem:: transmute ( as_u8) ) }
224234 }
225235
236+ #[ inline]
226237 fn read_isize ( & mut self ) -> Result < isize , Self :: Error > {
227238 read_sleb128 ! ( self , isize )
228239 }
229240
241+ #[ inline]
230242 fn read_bool ( & mut self ) -> Result < bool , Self :: Error > {
231243 let value = self . read_u8 ( ) ?;
232244 Ok ( value != 0 )
233245 }
234246
247+ #[ inline]
235248 fn read_f64 ( & mut self ) -> Result < f64 , Self :: Error > {
236249 let bits = self . read_u64 ( ) ?;
237250 Ok ( unsafe { :: std:: mem:: transmute ( bits) } )
238251 }
239252
253+ #[ inline]
240254 fn read_f32 ( & mut self ) -> Result < f32 , Self :: Error > {
241255 let bits = self . read_u32 ( ) ?;
242256 Ok ( unsafe { :: std:: mem:: transmute ( bits) } )
243257 }
244258
259+ #[ inline]
245260 fn read_char ( & mut self ) -> Result < char , Self :: Error > {
246261 let bits = self . read_u32 ( ) ?;
247262 Ok ( :: std:: char:: from_u32 ( bits) . unwrap ( ) )
248263 }
249264
265+ #[ inline]
250266 fn read_str ( & mut self ) -> Result < Cow < str > , Self :: Error > {
251267 let len = self . read_usize ( ) ?;
252268 let s = :: std:: str:: from_utf8 ( & self . data [ self . position ..self . position + len] ) . unwrap ( ) ;
0 commit comments