@@ -276,12 +276,13 @@ impl Serialize for Value<'_> {
276
276
277
277
///
278
278
pub mod path {
279
- use crate :: values:: Path ;
279
+ use std:: borrow:: Cow ;
280
+
280
281
#[ cfg( not( target_os = "windows" ) ) ]
281
282
use pwd:: Passwd ;
282
283
use quick_error:: ResultExt ;
283
- use std :: borrow :: Cow ;
284
- use std :: path :: PathBuf ;
284
+
285
+ use crate :: values :: Path ;
285
286
286
287
pub mod interpolate {
287
288
use quick_error:: quick_error;
@@ -358,7 +359,7 @@ pub mod path {
358
359
359
360
#[ cfg( target_os = "windows" ) ]
360
361
fn interpolate_user ( self ) -> Result < Cow < ' a , std:: path:: Path > , interpolate:: Error > {
361
- Err ( interpolate:: ErrorUserInterpolationUnsupported )
362
+ Err ( interpolate:: Error :: UserInterpolationUnsupported )
362
363
}
363
364
364
365
#[ cfg( not( target_os = "windows" ) ) ]
@@ -376,15 +377,16 @@ pub mod path {
376
377
. dir ;
377
378
let path_past_user_prefix =
378
379
git_features:: path:: from_byte_slice ( & path_with_leading_slash[ 1 ..] ) . context ( "path past ~user/" ) ?;
379
- Ok ( PathBuf :: from ( home) . join ( path_past_user_prefix) . into ( ) )
380
+ Ok ( std :: path :: PathBuf :: from ( home) . join ( path_past_user_prefix) . into ( ) )
380
381
}
381
382
}
382
383
383
384
#[ cfg( test) ]
384
385
mod tests {
385
- use crate :: values:: { path:: interpolate:: Error , Path } ;
386
386
use std:: borrow:: Cow ;
387
387
388
+ use crate :: values:: { path:: interpolate:: Error , Path } ;
389
+
388
390
#[ test]
389
391
fn not_interpolated ( ) {
390
392
let path = & b"/foo/bar" [ ..] ;
@@ -460,7 +462,7 @@ pub mod path {
460
462
fn user_interpolated ( ) {
461
463
assert ! ( matches!(
462
464
Path :: from( Cow :: Borrowed ( & b"~baz/foo/bar" [ ..] ) ) . interpolate( None ) ,
463
- Err ( path:: interpolate:: ErrorUserInterpolationUnsupported )
465
+ Err ( path:: interpolate:: Error :: UserInterpolationUnsupported )
464
466
) ) ;
465
467
}
466
468
0 commit comments