@@ -2012,7 +2012,6 @@ macro_rules! read_primitive {
2012
2012
2013
2013
impl :: Decoder < DecoderError > for Decoder {
2014
2014
fn read_nil ( & mut self ) -> DecodeResult < ( ) > {
2015
- debug ! ( "read_nil" ) ;
2016
2015
expect ! ( self . pop( ) , Null )
2017
2016
}
2018
2017
@@ -2030,7 +2029,6 @@ impl ::Decoder<DecoderError> for Decoder {
2030
2029
fn read_f32 ( & mut self ) -> DecodeResult < f32 > { self . read_f64 ( ) . map ( |x| x as f32 ) }
2031
2030
2032
2031
fn read_f64 ( & mut self ) -> DecodeResult < f64 > {
2033
- debug ! ( "read_f64" ) ;
2034
2032
match self . pop ( ) {
2035
2033
Json :: I64 ( f) => Ok ( f as f64 ) ,
2036
2034
Json :: U64 ( f) => Ok ( f as f64 ) ,
@@ -2049,7 +2047,6 @@ impl ::Decoder<DecoderError> for Decoder {
2049
2047
}
2050
2048
2051
2049
fn read_bool ( & mut self ) -> DecodeResult < bool > {
2052
- debug ! ( "read_bool" ) ;
2053
2050
expect ! ( self . pop( ) , Boolean )
2054
2051
}
2055
2052
@@ -2067,22 +2064,19 @@ impl ::Decoder<DecoderError> for Decoder {
2067
2064
}
2068
2065
2069
2066
fn read_str ( & mut self ) -> DecodeResult < string:: String > {
2070
- debug ! ( "read_str" ) ;
2071
2067
expect ! ( self . pop( ) , String )
2072
2068
}
2073
2069
2074
- fn read_enum < T , F > ( & mut self , name : & str , f : F ) -> DecodeResult < T > where
2070
+ fn read_enum < T , F > ( & mut self , _name : & str , f : F ) -> DecodeResult < T > where
2075
2071
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2076
2072
{
2077
- debug ! ( "read_enum({})" , name) ;
2078
2073
f ( self )
2079
2074
}
2080
2075
2081
2076
fn read_enum_variant < T , F > ( & mut self , names : & [ & str ] ,
2082
2077
mut f : F ) -> DecodeResult < T >
2083
2078
where F : FnMut ( & mut Decoder , uint ) -> DecodeResult < T > ,
2084
2079
{
2085
- debug ! ( "read_enum_variant(names={})" , names) ;
2086
2080
let name = match self . pop ( ) {
2087
2081
Json :: String ( s) => s,
2088
2082
Json :: Object ( mut o) => {
@@ -2122,49 +2116,44 @@ impl ::Decoder<DecoderError> for Decoder {
2122
2116
f ( self , idx)
2123
2117
}
2124
2118
2125
- fn read_enum_variant_arg < T , F > ( & mut self , idx : uint , f : F ) -> DecodeResult < T > where
2119
+ fn read_enum_variant_arg < T , F > ( & mut self , _idx : uint , f : F ) -> DecodeResult < T > where
2126
2120
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2127
2121
{
2128
- debug ! ( "read_enum_variant_arg(idx={})" , idx) ;
2129
2122
f ( self )
2130
2123
}
2131
2124
2132
2125
fn read_enum_struct_variant < T , F > ( & mut self , names : & [ & str ] , f : F ) -> DecodeResult < T > where
2133
2126
F : FnMut ( & mut Decoder , uint ) -> DecodeResult < T > ,
2134
2127
{
2135
- debug ! ( "read_enum_struct_variant(names={})" , names) ;
2136
2128
self . read_enum_variant ( names, f)
2137
2129
}
2138
2130
2139
2131
2140
2132
fn read_enum_struct_variant_field < T , F > ( & mut self ,
2141
- name : & str ,
2133
+ _name : & str ,
2142
2134
idx : uint ,
2143
2135
f : F )
2144
2136
-> DecodeResult < T > where
2145
2137
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2146
2138
{
2147
- debug ! ( "read_enum_struct_variant_field(name={}, idx={})" , name, idx) ;
2148
2139
self . read_enum_variant_arg ( idx, f)
2149
2140
}
2150
2141
2151
- fn read_struct < T , F > ( & mut self , name : & str , len : uint , f : F ) -> DecodeResult < T > where
2142
+ fn read_struct < T , F > ( & mut self , _name : & str , _len : uint , f : F ) -> DecodeResult < T > where
2152
2143
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2153
2144
{
2154
- debug ! ( "read_struct(name={}, len={})" , name, len) ;
2155
2145
let value = try!( f ( self ) ) ;
2156
2146
self . pop ( ) ;
2157
2147
Ok ( value)
2158
2148
}
2159
2149
2160
2150
fn read_struct_field < T , F > ( & mut self ,
2161
2151
name : & str ,
2162
- idx : uint ,
2152
+ _idx : uint ,
2163
2153
f : F )
2164
2154
-> DecodeResult < T > where
2165
2155
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2166
2156
{
2167
- debug ! ( "read_struct_field(name={}, idx={})" , name, idx) ;
2168
2157
let mut obj = try!( expect ! ( self . pop( ) , Object ) ) ;
2169
2158
2170
2159
let value = match obj. remove ( & name. to_string ( ) ) {
@@ -2189,7 +2178,6 @@ impl ::Decoder<DecoderError> for Decoder {
2189
2178
fn read_tuple < T , F > ( & mut self , tuple_len : uint , f : F ) -> DecodeResult < T > where
2190
2179
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2191
2180
{
2192
- debug ! ( "read_tuple()" ) ;
2193
2181
self . read_seq ( move |d, len| {
2194
2182
if len == tuple_len {
2195
2183
f ( d)
@@ -2202,18 +2190,16 @@ impl ::Decoder<DecoderError> for Decoder {
2202
2190
fn read_tuple_arg < T , F > ( & mut self , idx : uint , f : F ) -> DecodeResult < T > where
2203
2191
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2204
2192
{
2205
- debug ! ( "read_tuple_arg(idx={})" , idx) ;
2206
2193
self . read_seq_elt ( idx, f)
2207
2194
}
2208
2195
2209
2196
fn read_tuple_struct < T , F > ( & mut self ,
2210
- name : & str ,
2197
+ _name : & str ,
2211
2198
len : uint ,
2212
2199
f : F )
2213
2200
-> DecodeResult < T > where
2214
2201
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2215
2202
{
2216
- debug ! ( "read_tuple_struct(name={})" , name) ;
2217
2203
self . read_tuple ( len, f)
2218
2204
}
2219
2205
@@ -2223,14 +2209,12 @@ impl ::Decoder<DecoderError> for Decoder {
2223
2209
-> DecodeResult < T > where
2224
2210
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2225
2211
{
2226
- debug ! ( "read_tuple_struct_arg(idx={})" , idx) ;
2227
2212
self . read_tuple_arg ( idx, f)
2228
2213
}
2229
2214
2230
2215
fn read_option < T , F > ( & mut self , mut f : F ) -> DecodeResult < T > where
2231
2216
F : FnMut ( & mut Decoder , bool ) -> DecodeResult < T > ,
2232
2217
{
2233
- debug ! ( "read_option()" ) ;
2234
2218
match self . pop ( ) {
2235
2219
Json :: Null => f ( self , false ) ,
2236
2220
value => { self . stack . push ( value) ; f ( self , true ) }
@@ -2240,7 +2224,6 @@ impl ::Decoder<DecoderError> for Decoder {
2240
2224
fn read_seq < T , F > ( & mut self , f : F ) -> DecodeResult < T > where
2241
2225
F : FnOnce ( & mut Decoder , uint ) -> DecodeResult < T > ,
2242
2226
{
2243
- debug ! ( "read_seq()" ) ;
2244
2227
let array = try!( expect ! ( self . pop( ) , Array ) ) ;
2245
2228
let len = array. len ( ) ;
2246
2229
for v in array. into_iter ( ) . rev ( ) {
@@ -2249,17 +2232,15 @@ impl ::Decoder<DecoderError> for Decoder {
2249
2232
f ( self , len)
2250
2233
}
2251
2234
2252
- fn read_seq_elt < T , F > ( & mut self , idx : uint , f : F ) -> DecodeResult < T > where
2235
+ fn read_seq_elt < T , F > ( & mut self , _idx : uint , f : F ) -> DecodeResult < T > where
2253
2236
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2254
2237
{
2255
- debug ! ( "read_seq_elt(idx={})" , idx) ;
2256
2238
f ( self )
2257
2239
}
2258
2240
2259
2241
fn read_map < T , F > ( & mut self , f : F ) -> DecodeResult < T > where
2260
2242
F : FnOnce ( & mut Decoder , uint ) -> DecodeResult < T > ,
2261
2243
{
2262
- debug ! ( "read_map()" ) ;
2263
2244
let obj = try!( expect ! ( self . pop( ) , Object ) ) ;
2264
2245
let len = obj. len ( ) ;
2265
2246
for ( key, value) in obj. into_iter ( ) {
@@ -2269,17 +2250,15 @@ impl ::Decoder<DecoderError> for Decoder {
2269
2250
f ( self , len)
2270
2251
}
2271
2252
2272
- fn read_map_elt_key < T , F > ( & mut self , idx : uint , f : F ) -> DecodeResult < T > where
2253
+ fn read_map_elt_key < T , F > ( & mut self , _idx : uint , f : F ) -> DecodeResult < T > where
2273
2254
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2274
2255
{
2275
- debug ! ( "read_map_elt_key(idx={})" , idx) ;
2276
2256
f ( self )
2277
2257
}
2278
2258
2279
- fn read_map_elt_val < T , F > ( & mut self , idx : uint , f : F ) -> DecodeResult < T > where
2259
+ fn read_map_elt_val < T , F > ( & mut self , _idx : uint , f : F ) -> DecodeResult < T > where
2280
2260
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2281
2261
{
2282
- debug ! ( "read_map_elt_val(idx={})" , idx) ;
2283
2262
f ( self )
2284
2263
}
2285
2264
@@ -2441,9 +2420,7 @@ mod tests {
2441
2420
use super :: ParserError :: * ;
2442
2421
use super :: DecoderError :: * ;
2443
2422
use super :: JsonEvent :: * ;
2444
- use super :: ParserState :: * ;
2445
2423
use super :: StackElement :: * ;
2446
- use super :: InternalStackElement :: * ;
2447
2424
use super :: { PrettyEncoder , Json , from_str, DecodeResult , DecoderError , JsonEvent , Parser ,
2448
2425
StackElement , Stack , Encoder , Decoder } ;
2449
2426
use std:: { i64, u64, f32, f64, io} ;
@@ -2678,8 +2655,6 @@ mod tests {
2678
2655
}
2679
2656
2680
2657
fn with_str_writer < F > ( f : F ) -> string:: String where F : FnOnce ( & mut io:: Writer ) {
2681
- use std:: str;
2682
-
2683
2658
let mut m = Vec :: new ( ) ;
2684
2659
f ( & mut m as & mut io:: Writer ) ;
2685
2660
string:: String :: from_utf8 ( m) . unwrap ( )
0 commit comments