This repository was archived by the owner on Dec 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1148,17 +1148,17 @@ impl Json {
1148
1148
impl < ' a > Index < & ' a str > for Json {
1149
1149
type Output = Json ;
1150
1150
1151
- fn index ( & self , idx : & & str ) -> & Json {
1152
- self . find ( * idx) . unwrap ( )
1151
+ fn index ( & self , idx : & str ) -> & Json {
1152
+ self . find ( idx) . unwrap ( )
1153
1153
}
1154
1154
}
1155
1155
1156
1156
impl Index < usize > for Json {
1157
1157
type Output = Json ;
1158
1158
1159
- fn index < ' a > ( & ' a self , idx : & usize ) -> & ' a Json {
1159
+ fn index < ' a > ( & ' a self , idx : usize ) -> & ' a Json {
1160
1160
match self {
1161
- & Json :: Array ( ref v) => & v[ * idx] ,
1161
+ & Json :: Array ( ref v) => & v[ idx] ,
1162
1162
_ => panic ! ( "can only index Json with usize if it is an array" )
1163
1163
}
1164
1164
}
Original file line number Diff line number Diff line change 10
10
11
11
//! Support code for encoding and decoding types.
12
12
13
- #![ feature( core, std_misc ) ]
13
+ #![ feature( core, convert ) ]
14
14
#![ doc( html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" ,
15
15
html_favicon_url = "http://www.rust-lang.org/favicon.ico" ,
16
16
html_root_url = "http://doc.rust-lang.org/rustc-serialize/" ) ]
Original file line number Diff line number Diff line change @@ -570,14 +570,14 @@ impl Decodable for path::PathBuf {
570
570
use std:: os:: unix:: prelude:: * ;
571
571
let bytes: Vec < u8 > = try!( Decodable :: decode ( d) ) ;
572
572
let s: OsString = OsStringExt :: from_vec ( bytes) ;
573
- Ok ( path:: PathBuf :: new ( & s) )
573
+ Ok ( path:: PathBuf :: from ( s) )
574
574
}
575
575
#[ cfg( windows) ]
576
576
fn decode < D : Decoder > ( d : & mut D ) -> Result < path:: PathBuf , D :: Error > {
577
577
use std:: os:: windows:: prelude:: * ;
578
578
let bytes: Vec < u16 > = try!( Decodable :: decode ( d) ) ;
579
579
let s: OsString = OsStringExt :: from_wide ( & bytes) ;
580
- Ok ( path:: PathBuf :: new ( & s) )
580
+ Ok ( path:: PathBuf :: from ( s) )
581
581
}
582
582
}
583
583
You can’t perform that action at this time.
0 commit comments