@@ -54,7 +54,7 @@ impl<'a> serialize::Encoder for Encoder<'a> {
54
54
Ok ( ( ) )
55
55
}
56
56
57
- fn emit_uint ( & mut self , v : usize ) -> EncodeResult {
57
+ fn emit_usize ( & mut self , v : usize ) -> EncodeResult {
58
58
write_uleb128 ! ( self , v)
59
59
}
60
60
@@ -75,7 +75,7 @@ impl<'a> serialize::Encoder for Encoder<'a> {
75
75
Ok ( ( ) )
76
76
}
77
77
78
- fn emit_int ( & mut self , v : isize ) -> EncodeResult {
78
+ fn emit_isize ( & mut self , v : isize ) -> EncodeResult {
79
79
write_sleb128 ! ( self , v)
80
80
}
81
81
@@ -120,7 +120,7 @@ impl<'a> serialize::Encoder for Encoder<'a> {
120
120
}
121
121
122
122
fn emit_str ( & mut self , v : & str ) -> EncodeResult {
123
- self . emit_uint ( v. len ( ) ) ?;
123
+ self . emit_usize ( v. len ( ) ) ?;
124
124
let _ = self . cursor . write_all ( v. as_bytes ( ) ) ;
125
125
Ok ( ( ) )
126
126
}
@@ -139,7 +139,7 @@ impl<'a> serialize::Encoder for Encoder<'a> {
139
139
-> EncodeResult
140
140
where F : FnOnce ( & mut Self ) -> EncodeResult
141
141
{
142
- self . emit_uint ( v_id) ?;
142
+ self . emit_usize ( v_id) ?;
143
143
f ( self )
144
144
}
145
145
@@ -221,7 +221,7 @@ impl<'a> serialize::Encoder for Encoder<'a> {
221
221
fn emit_seq < F > ( & mut self , len : usize , f : F ) -> EncodeResult
222
222
where F : FnOnce ( & mut Encoder < ' a > ) -> EncodeResult
223
223
{
224
- self . emit_uint ( len) ?;
224
+ self . emit_usize ( len) ?;
225
225
f ( self )
226
226
}
227
227
@@ -234,7 +234,7 @@ impl<'a> serialize::Encoder for Encoder<'a> {
234
234
fn emit_map < F > ( & mut self , len : usize , f : F ) -> EncodeResult
235
235
where F : FnOnce ( & mut Encoder < ' a > ) -> EncodeResult
236
236
{
237
- self . emit_uint ( len) ?;
237
+ self . emit_usize ( len) ?;
238
238
f ( self )
239
239
}
240
240
@@ -329,7 +329,7 @@ impl<'a> serialize::Decoder for Decoder<'a> {
329
329
Ok ( value)
330
330
}
331
331
332
- fn read_uint ( & mut self ) -> Result < usize , Self :: Error > {
332
+ fn read_usize ( & mut self ) -> Result < usize , Self :: Error > {
333
333
read_uleb128 ! ( self , usize )
334
334
}
335
335
@@ -351,7 +351,7 @@ impl<'a> serialize::Decoder for Decoder<'a> {
351
351
unsafe { Ok ( :: std:: mem:: transmute ( as_u8) ) }
352
352
}
353
353
354
- fn read_int ( & mut self ) -> Result < isize , Self :: Error > {
354
+ fn read_isize ( & mut self ) -> Result < isize , Self :: Error > {
355
355
read_sleb128 ! ( self , isize )
356
356
}
357
357
@@ -376,7 +376,7 @@ impl<'a> serialize::Decoder for Decoder<'a> {
376
376
}
377
377
378
378
fn read_str ( & mut self ) -> Result < String , Self :: Error > {
379
- let len = self . read_uint ( ) ?;
379
+ let len = self . read_usize ( ) ?;
380
380
let s = :: std:: str:: from_utf8 ( & self . data [ self . position ..self . position + len] ) . unwrap ( ) ;
381
381
self . position += len;
382
382
Ok ( s. to_string ( ) )
@@ -391,7 +391,7 @@ impl<'a> serialize::Decoder for Decoder<'a> {
391
391
fn read_enum_variant < T , F > ( & mut self , _: & [ & str ] , mut f : F ) -> Result < T , Self :: Error >
392
392
where F : FnMut ( & mut Decoder < ' a > , usize ) -> Result < T , Self :: Error >
393
393
{
394
- let disr = self . read_uint ( ) ?;
394
+ let disr = self . read_usize ( ) ?;
395
395
f ( self , disr)
396
396
}
397
397
@@ -404,7 +404,7 @@ impl<'a> serialize::Decoder for Decoder<'a> {
404
404
fn read_enum_struct_variant < T , F > ( & mut self , _: & [ & str ] , mut f : F ) -> Result < T , Self :: Error >
405
405
where F : FnMut ( & mut Decoder < ' a > , usize ) -> Result < T , Self :: Error >
406
406
{
407
- let disr = self . read_uint ( ) ?;
407
+ let disr = self . read_usize ( ) ?;
408
408
f ( self , disr)
409
409
}
410
410
@@ -483,7 +483,7 @@ impl<'a> serialize::Decoder for Decoder<'a> {
483
483
fn read_seq < T , F > ( & mut self , f : F ) -> Result < T , Self :: Error >
484
484
where F : FnOnce ( & mut Decoder < ' a > , usize ) -> Result < T , Self :: Error >
485
485
{
486
- let len = self . read_uint ( ) ?;
486
+ let len = self . read_usize ( ) ?;
487
487
f ( self , len)
488
488
}
489
489
@@ -496,7 +496,7 @@ impl<'a> serialize::Decoder for Decoder<'a> {
496
496
fn read_map < T , F > ( & mut self , f : F ) -> Result < T , Self :: Error >
497
497
where F : FnOnce ( & mut Decoder < ' a > , usize ) -> Result < T , Self :: Error >
498
498
{
499
- let len = self . read_uint ( ) ?;
499
+ let len = self . read_usize ( ) ?;
500
500
f ( self , len)
501
501
}
502
502
0 commit comments