File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 22
33use std:: { borrow:: Cow , convert:: TryFrom , fmt:: Display , str:: FromStr } ;
44
5- use nom:: AsChar ;
65#[ cfg( not( target_os = "windows" ) ) ]
76use pwd:: Passwd ;
87use quick_error:: { quick_error, ResultExt } ;
@@ -381,13 +380,13 @@ impl<'a> Path<'a> {
381380 }
382381
383382 #[ cfg( target_os = "windows" ) ]
384- fn interpolate_user ( self ) -> Result < Self , PathError > {
383+ fn interpolate_user ( self ) -> Result < Cow < ' a , std :: path :: Path > , PathError > {
385384 Err ( PathError :: UserInterpolationUnsupported )
386385 }
387386
388387 #[ cfg( not( target_os = "windows" ) ) ]
389388 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 ( ) ) ;
391390 let i = val
392391 . iter ( )
393392 . position ( |& e| e == b'/' )
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ pub mod index {
8888 where
8989 Find : for < ' a > FnMut ( & oid , & ' a mut Vec < u8 > ) -> Option < git_object:: BlobRef < ' a > > ,
9090 {
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 ( |_ | {
9292 index:: checkout:: Error :: IllformedUtf8 {
9393 path : entry_path. to_owned ( ) ,
9494 }
@@ -126,7 +126,7 @@ pub mod index {
126126 path : root. to_path_buf ( ) ,
127127 } ) ?;
128128 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 ( ) } ) ?;
130130 if symlinks {
131131 #[ cfg( unix) ]
132132 std:: os:: unix:: fs:: symlink ( symlink_destination, & dest) ?;
You can’t perform that action at this time.
0 commit comments