@@ -15,8 +15,6 @@ pub enum ExitCode {
1515 User = 1 ,
1616 /// System error (git, network, I/O)
1717 System = 2 ,
18- /// Validation failure (checks failed, SSH, remotes)
19- Validation = 3 ,
2018}
2119
2220impl ExitCode {
@@ -35,9 +33,6 @@ pub enum RailError {
3533 /// Git operation errors
3634 Git ( GitError ) ,
3735
38- /// Validation errors (SSH, paths, etc.)
39- Validation ( ValidationError ) ,
40-
4136 /// I/O errors
4237 Io ( io:: Error ) ,
4338
@@ -86,7 +81,6 @@ impl RailError {
8681 match self {
8782 RailError :: Config ( _) => ExitCode :: User ,
8883 RailError :: Git ( _) => ExitCode :: System ,
89- RailError :: Validation ( _) => ExitCode :: Validation ,
9084 RailError :: Io ( _) => ExitCode :: System ,
9185 RailError :: Message { .. } => ExitCode :: User ,
9286 }
@@ -97,7 +91,6 @@ impl RailError {
9791 match self {
9892 RailError :: Config ( e) => e. help_message ( ) ,
9993 RailError :: Git ( e) => e. help_message ( ) ,
100- RailError :: Validation ( e) => e. help_message ( ) ,
10194 RailError :: Message { help, .. } => help. clone ( ) ,
10295 _ => None ,
10396 }
@@ -109,7 +102,6 @@ impl fmt::Display for RailError {
109102 match self {
110103 RailError :: Config ( e) => write ! ( f, "{}" , e) ,
111104 RailError :: Git ( e) => write ! ( f, "{}" , e) ,
112- RailError :: Validation ( e) => write ! ( f, "{}" , e) ,
113105 RailError :: Io ( e) => write ! ( f, "I/O error: {}" , e) ,
114106 RailError :: Message { message, context, .. } => {
115107 write ! ( f, "{}" , message) ?;
@@ -315,42 +307,6 @@ impl fmt::Display for GitError {
315307 }
316308}
317309
318- /// Validation errors
319- #[ derive( Debug ) ]
320- pub enum ValidationError {
321- /// SSH key not found or invalid
322- SshKey { message : String } ,
323-
324- /// Workspace validation failed
325- WorkspaceInvalid { reason : String } ,
326- }
327-
328- impl ValidationError {
329- fn help_message ( & self ) -> Option < String > {
330- match self {
331- ValidationError :: SshKey { .. } => {
332- Some ( "Create an SSH key with: ssh-keygen -t ed25519 -C \" [email protected] \" " . to_string ( ) ) 333- }
334- ValidationError :: WorkspaceInvalid { .. } => {
335- Some ( "Run `cargo rail doctor` to diagnose workspace issues." . to_string ( ) )
336- }
337- }
338- }
339- }
340-
341- impl fmt:: Display for ValidationError {
342- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
343- match self {
344- ValidationError :: SshKey { message } => {
345- write ! ( f, "SSH key validation failed: {}" , message)
346- }
347- ValidationError :: WorkspaceInvalid { reason } => {
348- write ! ( f, "Workspace validation failed: {}" , reason)
349- }
350- }
351- }
352- }
353-
354310/// Result type alias for cargo-rail
355311pub type RailResult < T > = Result < T , RailError > ;
356312
0 commit comments