8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- #![ feature( std_misc , io) ]
11
+ #![ feature( convert , io) ]
12
12
#![ doc( html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" ,
13
13
html_favicon_url = "http://www.rust-lang.org/favicon.ico" ,
14
14
html_root_url = "http://doc.rust-lang.org/tempdir/" ) ]
@@ -19,7 +19,7 @@ extern crate rand;
19
19
use std:: env;
20
20
use std:: io:: { self , Error , ErrorKind } ;
21
21
use std:: fs;
22
- use std:: path:: { self , PathBuf , AsPath } ;
22
+ use std:: path:: { self , PathBuf , Path } ;
23
23
use rand:: { thread_rng, Rng } ;
24
24
25
25
/// A wrapper for a path to temporary directory implementing automatic
@@ -43,10 +43,10 @@ impl TempDir {
43
43
/// deleted once the returned wrapper is destroyed.
44
44
///
45
45
/// If no directory can be created, `Err` is returned.
46
- pub fn new_in < P : AsPath + ? Sized > ( tmpdir : & P , prefix : & str )
47
- -> io:: Result < TempDir > {
46
+ pub fn new_in < P : AsRef < Path > > ( tmpdir : P , prefix : & str )
47
+ -> io:: Result < TempDir > {
48
48
let storage;
49
- let mut tmpdir = tmpdir. as_path ( ) ;
49
+ let mut tmpdir = tmpdir. as_ref ( ) ;
50
50
if !tmpdir. is_absolute ( ) {
51
51
let cur_dir = try!( env:: current_dir ( ) ) ;
52
52
storage = cur_dir. join ( tmpdir) ;
0 commit comments