File tree 2 files changed +4
-5
lines changed
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
use std:: { borrow:: Cow , convert:: TryFrom , fmt:: Display , str:: FromStr } ;
4
4
5
- use nom:: AsChar ;
6
5
#[ cfg( not( target_os = "windows" ) ) ]
7
6
use pwd:: Passwd ;
8
7
use quick_error:: { quick_error, ResultExt } ;
@@ -381,13 +380,13 @@ impl<'a> Path<'a> {
381
380
}
382
381
383
382
#[ cfg( target_os = "windows" ) ]
384
- fn interpolate_user ( self ) -> Result < Self , PathError > {
383
+ fn interpolate_user ( self ) -> Result < Cow < ' a , std :: path :: Path > , PathError > {
385
384
Err ( PathError :: UserInterpolationUnsupported )
386
385
}
387
386
388
387
#[ cfg( not( target_os = "windows" ) ) ]
389
388
fn interpolate_user ( self ) -> Result < Cow < ' a , std:: path:: Path > , PathError > {
390
- let ( _prefix, val) = self . split_at ( '/' . len ( ) ) ;
389
+ let ( _prefix, val) = self . split_at ( "/" . len ( ) ) ;
391
390
let i = val
392
391
. iter ( )
393
392
. position ( |& e| e == b'/' )
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ pub mod index {
88
88
where
89
89
Find : for < ' a > FnMut ( & oid , & ' a mut Vec < u8 > ) -> Option < git_object:: BlobRef < ' a > > ,
90
90
{
91
- let dest = root. join ( git_features:: path:: from_byte_slice ( entry_path) . ok_or_else ( | | {
91
+ let dest = root. join ( git_features:: path:: from_byte_slice ( entry_path) . map_err ( |_ | {
92
92
index:: checkout:: Error :: IllformedUtf8 {
93
93
path : entry_path. to_owned ( ) ,
94
94
}
@@ -126,7 +126,7 @@ pub mod index {
126
126
path : root. to_path_buf ( ) ,
127
127
} ) ?;
128
128
let symlink_destination = git_features:: path:: from_byte_slice ( obj. data )
129
- . ok_or_else ( | | index:: checkout:: Error :: IllformedUtf8 { path : obj. data . into ( ) } ) ?;
129
+ . map_err ( |_ | index:: checkout:: Error :: IllformedUtf8 { path : obj. data . into ( ) } ) ?;
130
130
if symlinks {
131
131
#[ cfg( unix) ]
132
132
std:: os:: unix:: fs:: symlink ( symlink_destination, & dest) ?;
You can’t perform that action at this time.
0 commit comments