@@ -2016,7 +2016,6 @@ macro_rules! read_primitive {
2016
2016
2017
2017
impl :: Decoder < DecoderError > for Decoder {
2018
2018
fn read_nil ( & mut self ) -> DecodeResult < ( ) > {
2019
- debug ! ( "read_nil" ) ;
2020
2019
expect ! ( self . pop( ) , Null )
2021
2020
}
2022
2021
@@ -2034,7 +2033,6 @@ impl ::Decoder<DecoderError> for Decoder {
2034
2033
fn read_f32 ( & mut self ) -> DecodeResult < f32 > { self . read_f64 ( ) . map ( |x| x as f32 ) }
2035
2034
2036
2035
fn read_f64 ( & mut self ) -> DecodeResult < f64 > {
2037
- debug ! ( "read_f64" ) ;
2038
2036
match self . pop ( ) {
2039
2037
Json :: I64 ( f) => Ok ( f as f64 ) ,
2040
2038
Json :: U64 ( f) => Ok ( f as f64 ) ,
@@ -2053,7 +2051,6 @@ impl ::Decoder<DecoderError> for Decoder {
2053
2051
}
2054
2052
2055
2053
fn read_bool ( & mut self ) -> DecodeResult < bool > {
2056
- debug ! ( "read_bool" ) ;
2057
2054
expect ! ( self . pop( ) , Boolean )
2058
2055
}
2059
2056
@@ -2071,22 +2068,19 @@ impl ::Decoder<DecoderError> for Decoder {
2071
2068
}
2072
2069
2073
2070
fn read_str ( & mut self ) -> DecodeResult < string:: String > {
2074
- debug ! ( "read_str" ) ;
2075
2071
expect ! ( self . pop( ) , String )
2076
2072
}
2077
2073
2078
- fn read_enum < T , F > ( & mut self , name : & str , f : F ) -> DecodeResult < T > where
2074
+ fn read_enum < T , F > ( & mut self , _name : & str , f : F ) -> DecodeResult < T > where
2079
2075
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2080
2076
{
2081
- debug ! ( "read_enum({})" , name) ;
2082
2077
f ( self )
2083
2078
}
2084
2079
2085
2080
fn read_enum_variant < T , F > ( & mut self , names : & [ & str ] ,
2086
2081
mut f : F ) -> DecodeResult < T >
2087
2082
where F : FnMut ( & mut Decoder , uint ) -> DecodeResult < T > ,
2088
2083
{
2089
- debug ! ( "read_enum_variant(names={})" , names) ;
2090
2084
let name = match self . pop ( ) {
2091
2085
Json :: String ( s) => s,
2092
2086
Json :: Object ( mut o) => {
@@ -2126,49 +2120,44 @@ impl ::Decoder<DecoderError> for Decoder {
2126
2120
f ( self , idx)
2127
2121
}
2128
2122
2129
- fn read_enum_variant_arg < T , F > ( & mut self , idx : uint , f : F ) -> DecodeResult < T > where
2123
+ fn read_enum_variant_arg < T , F > ( & mut self , _idx : uint , f : F ) -> DecodeResult < T > where
2130
2124
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2131
2125
{
2132
- debug ! ( "read_enum_variant_arg(idx={})" , idx) ;
2133
2126
f ( self )
2134
2127
}
2135
2128
2136
2129
fn read_enum_struct_variant < T , F > ( & mut self , names : & [ & str ] , f : F ) -> DecodeResult < T > where
2137
2130
F : FnMut ( & mut Decoder , uint ) -> DecodeResult < T > ,
2138
2131
{
2139
- debug ! ( "read_enum_struct_variant(names={})" , names) ;
2140
2132
self . read_enum_variant ( names, f)
2141
2133
}
2142
2134
2143
2135
2144
2136
fn read_enum_struct_variant_field < T , F > ( & mut self ,
2145
- name : & str ,
2137
+ _name : & str ,
2146
2138
idx : uint ,
2147
2139
f : F )
2148
2140
-> DecodeResult < T > where
2149
2141
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2150
2142
{
2151
- debug ! ( "read_enum_struct_variant_field(name={}, idx={})" , name, idx) ;
2152
2143
self . read_enum_variant_arg ( idx, f)
2153
2144
}
2154
2145
2155
- fn read_struct < T , F > ( & mut self , name : & str , len : uint , f : F ) -> DecodeResult < T > where
2146
+ fn read_struct < T , F > ( & mut self , _name : & str , _len : uint , f : F ) -> DecodeResult < T > where
2156
2147
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2157
2148
{
2158
- debug ! ( "read_struct(name={}, len={})" , name, len) ;
2159
2149
let value = try!( f ( self ) ) ;
2160
2150
self . pop ( ) ;
2161
2151
Ok ( value)
2162
2152
}
2163
2153
2164
2154
fn read_struct_field < T , F > ( & mut self ,
2165
2155
name : & str ,
2166
- idx : uint ,
2156
+ _idx : uint ,
2167
2157
f : F )
2168
2158
-> DecodeResult < T > where
2169
2159
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2170
2160
{
2171
- debug ! ( "read_struct_field(name={}, idx={})" , name, idx) ;
2172
2161
let mut obj = try!( expect ! ( self . pop( ) , Object ) ) ;
2173
2162
2174
2163
let value = match obj. remove ( & name. to_string ( ) ) {
@@ -2193,7 +2182,6 @@ impl ::Decoder<DecoderError> for Decoder {
2193
2182
fn read_tuple < T , F > ( & mut self , tuple_len : uint , f : F ) -> DecodeResult < T > where
2194
2183
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2195
2184
{
2196
- debug ! ( "read_tuple()" ) ;
2197
2185
self . read_seq ( move |d, len| {
2198
2186
if len == tuple_len {
2199
2187
f ( d)
@@ -2206,18 +2194,16 @@ impl ::Decoder<DecoderError> for Decoder {
2206
2194
fn read_tuple_arg < T , F > ( & mut self , idx : uint , f : F ) -> DecodeResult < T > where
2207
2195
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2208
2196
{
2209
- debug ! ( "read_tuple_arg(idx={})" , idx) ;
2210
2197
self . read_seq_elt ( idx, f)
2211
2198
}
2212
2199
2213
2200
fn read_tuple_struct < T , F > ( & mut self ,
2214
- name : & str ,
2201
+ _name : & str ,
2215
2202
len : uint ,
2216
2203
f : F )
2217
2204
-> DecodeResult < T > where
2218
2205
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2219
2206
{
2220
- debug ! ( "read_tuple_struct(name={})" , name) ;
2221
2207
self . read_tuple ( len, f)
2222
2208
}
2223
2209
@@ -2227,14 +2213,12 @@ impl ::Decoder<DecoderError> for Decoder {
2227
2213
-> DecodeResult < T > where
2228
2214
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2229
2215
{
2230
- debug ! ( "read_tuple_struct_arg(idx={})" , idx) ;
2231
2216
self . read_tuple_arg ( idx, f)
2232
2217
}
2233
2218
2234
2219
fn read_option < T , F > ( & mut self , mut f : F ) -> DecodeResult < T > where
2235
2220
F : FnMut ( & mut Decoder , bool ) -> DecodeResult < T > ,
2236
2221
{
2237
- debug ! ( "read_option()" ) ;
2238
2222
match self . pop ( ) {
2239
2223
Json :: Null => f ( self , false ) ,
2240
2224
value => { self . stack . push ( value) ; f ( self , true ) }
@@ -2244,7 +2228,6 @@ impl ::Decoder<DecoderError> for Decoder {
2244
2228
fn read_seq < T , F > ( & mut self , f : F ) -> DecodeResult < T > where
2245
2229
F : FnOnce ( & mut Decoder , uint ) -> DecodeResult < T > ,
2246
2230
{
2247
- debug ! ( "read_seq()" ) ;
2248
2231
let array = try!( expect ! ( self . pop( ) , Array ) ) ;
2249
2232
let len = array. len ( ) ;
2250
2233
for v in array. into_iter ( ) . rev ( ) {
@@ -2253,17 +2236,15 @@ impl ::Decoder<DecoderError> for Decoder {
2253
2236
f ( self , len)
2254
2237
}
2255
2238
2256
- fn read_seq_elt < T , F > ( & mut self , idx : uint , f : F ) -> DecodeResult < T > where
2239
+ fn read_seq_elt < T , F > ( & mut self , _idx : uint , f : F ) -> DecodeResult < T > where
2257
2240
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2258
2241
{
2259
- debug ! ( "read_seq_elt(idx={})" , idx) ;
2260
2242
f ( self )
2261
2243
}
2262
2244
2263
2245
fn read_map < T , F > ( & mut self , f : F ) -> DecodeResult < T > where
2264
2246
F : FnOnce ( & mut Decoder , uint ) -> DecodeResult < T > ,
2265
2247
{
2266
- debug ! ( "read_map()" ) ;
2267
2248
let obj = try!( expect ! ( self . pop( ) , Object ) ) ;
2268
2249
let len = obj. len ( ) ;
2269
2250
for ( key, value) in obj. into_iter ( ) {
@@ -2273,17 +2254,15 @@ impl ::Decoder<DecoderError> for Decoder {
2273
2254
f ( self , len)
2274
2255
}
2275
2256
2276
- fn read_map_elt_key < T , F > ( & mut self , idx : uint , f : F ) -> DecodeResult < T > where
2257
+ fn read_map_elt_key < T , F > ( & mut self , _idx : uint , f : F ) -> DecodeResult < T > where
2277
2258
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2278
2259
{
2279
- debug ! ( "read_map_elt_key(idx={})" , idx) ;
2280
2260
f ( self )
2281
2261
}
2282
2262
2283
- fn read_map_elt_val < T , F > ( & mut self , idx : uint , f : F ) -> DecodeResult < T > where
2263
+ fn read_map_elt_val < T , F > ( & mut self , _idx : uint , f : F ) -> DecodeResult < T > where
2284
2264
F : FnOnce ( & mut Decoder ) -> DecodeResult < T > ,
2285
2265
{
2286
- debug ! ( "read_map_elt_val(idx={})" , idx) ;
2287
2266
f ( self )
2288
2267
}
2289
2268
@@ -2445,9 +2424,7 @@ mod tests {
2445
2424
use super :: ParserError :: * ;
2446
2425
use super :: DecoderError :: * ;
2447
2426
use super :: JsonEvent :: * ;
2448
- use super :: ParserState :: * ;
2449
2427
use super :: StackElement :: * ;
2450
- use super :: InternalStackElement :: * ;
2451
2428
use super :: { PrettyEncoder , Json , from_str, DecodeResult , DecoderError , JsonEvent , Parser ,
2452
2429
StackElement , Stack , Encoder , Decoder } ;
2453
2430
use std:: { i64, u64, f32, f64, io} ;
@@ -2682,8 +2659,6 @@ mod tests {
2682
2659
}
2683
2660
2684
2661
fn with_str_writer < F > ( f : F ) -> string:: String where F : FnOnce ( & mut io:: Writer ) {
2685
- use std:: str;
2686
-
2687
2662
let mut m = Vec :: new ( ) ;
2688
2663
f ( & mut m as & mut io:: Writer ) ;
2689
2664
string:: String :: from_utf8 ( m) . unwrap ( )
0 commit comments