File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,10 +84,6 @@ enum CatError {
8484 /// Wrapper around `io::Error`
8585 #[ error( "{}" , strip_errno( . 0 ) ) ]
8686 Io ( #[ from] io:: Error ) ,
87- /// Wrapper around `rustix::io::Errno`
88- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
89- #[ error( "{0}" ) ]
90- Rustix ( #[ from] rustix:: io:: Errno ) ,
9187 /// Unknown file type; it's not a regular file, socket, etc.
9288 #[ error( "{}" , translate!( "cat-error-unknown-filetype" , "ft_debug" => . ft_debug) ) ]
9389 UnknownFiletype {
@@ -107,6 +103,13 @@ enum CatError {
107103
108104type CatResult < T > = Result < T , CatError > ;
109105
106+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
107+ impl From < rustix:: io:: Errno > for CatError {
108+ fn from ( value : rustix:: io:: Errno ) -> Self {
109+ Self :: Io ( value. into ( ) )
110+ }
111+ }
112+
110113#[ derive( PartialEq ) ]
111114enum NumberingMode {
112115 None ,
@@ -453,7 +456,7 @@ fn get_input_type(path: &OsString) -> CatResult<InputType> {
453456 return Err ( CatError :: TooManySymlinks ) ;
454457 }
455458 }
456- return Err ( CatError :: Io ( e ) ) ;
459+ return Err ( e . into ( ) ) ;
457460 }
458461 } ;
459462 match ft {
You can’t perform that action at this time.
0 commit comments