File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -379,7 +379,7 @@ impl StdError for DecoderError {
379
379
fn description ( & self ) -> & str { "decoder error" }
380
380
fn cause ( & self ) -> Option < & StdError > {
381
381
match * self {
382
- DecoderError :: ParseError ( ref e) => Some ( e as & StdError ) ,
382
+ DecoderError :: ParseError ( ref e) => Some ( e) ,
383
383
_ => None ,
384
384
}
385
385
}
@@ -3844,13 +3844,12 @@ mod tests {
3844
3844
#[ test]
3845
3845
fn test_encode_hashmap_with_arbitrary_key ( ) {
3846
3846
use std:: collections:: HashMap ;
3847
- use std:: fmt;
3848
3847
#[ derive( PartialEq , Eq , Hash , RustcEncodable ) ]
3849
3848
struct ArbitraryType ( u32 ) ;
3850
3849
let mut hm: HashMap < ArbitraryType , bool > = HashMap :: new ( ) ;
3851
3850
hm. insert ( ArbitraryType ( 1 ) , true ) ;
3852
3851
let mut mem_buf = string:: String :: new ( ) ;
3853
- let mut encoder = Encoder :: new ( & mut mem_buf as & mut fmt :: Write ) ;
3852
+ let mut encoder = Encoder :: new ( & mut mem_buf) ;
3854
3853
let result = hm. encode ( & mut encoder) ;
3855
3854
match result. err ( ) . unwrap ( ) {
3856
3855
EncoderError :: BadHashmapKey => ( ) ,
Original file line number Diff line number Diff line change 16
16
html_root_url = "http://doc.rust-lang.org/rustc-serialize/" ) ]
17
17
#![ cfg_attr( test, deny( warnings) ) ]
18
18
#![ cfg_attr( test, feature( test, std_misc) ) ]
19
+ #![ allow( trivial_numeric_casts) ]
19
20
20
21
#[ cfg( test) ] extern crate test;
21
22
#[ cfg( test) ] extern crate rand;
You can’t perform that action at this time.
0 commit comments