Skip to content

Commit 48dd8a0

Browse files
Copilotjosecelano
andcommitted
fix: resolve clippy linting warnings
- Merge identical match arms in error help method - Replace wildcard patterns with explicit variants in test assertions Co-authored-by: josecelano <58816+josecelano@users.noreply.github.com>
1 parent 6e19205 commit 48dd8a0

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

src/presentation/cli/mod.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ mod tests {
184184
crate::presentation::cli::CreateAction::Environment { env_file } => {
185185
assert_eq!(env_file, std::path::PathBuf::from("config.json"));
186186
}
187-
_ => panic!("Expected Environment action"),
187+
crate::presentation::cli::CreateAction::Template { .. } => {
188+
panic!("Expected Environment action")
189+
}
188190
},
189191
Commands::Destroy { .. } => panic!("Expected Create command"),
190192
}
@@ -206,7 +208,9 @@ mod tests {
206208
crate::presentation::cli::CreateAction::Environment { env_file } => {
207209
assert_eq!(env_file, std::path::PathBuf::from("env.json"));
208210
}
209-
_ => panic!("Expected Environment action"),
211+
crate::presentation::cli::CreateAction::Template { .. } => {
212+
panic!("Expected Environment action")
213+
}
210214
},
211215
Commands::Destroy { .. } => panic!("Expected Create command"),
212216
}
@@ -249,7 +253,9 @@ mod tests {
249253
crate::presentation::cli::CreateAction::Environment { env_file } => {
250254
assert_eq!(env_file, std::path::PathBuf::from("config.json"));
251255
}
252-
_ => panic!("Expected Environment action"),
256+
crate::presentation::cli::CreateAction::Template { .. } => {
257+
panic!("Expected Environment action")
258+
}
253259
},
254260
Commands::Destroy { .. } => panic!("Expected Create command"),
255261
}
@@ -295,7 +301,9 @@ mod tests {
295301
crate::presentation::cli::CreateAction::Template { output_path } => {
296302
assert!(output_path.is_none());
297303
}
298-
_ => panic!("Expected Template action"),
304+
crate::presentation::cli::CreateAction::Environment { .. } => {
305+
panic!("Expected Template action")
306+
}
299307
},
300308
Commands::Destroy { .. } => panic!("Expected Create command"),
301309
}
@@ -319,7 +327,9 @@ mod tests {
319327
Some(std::path::PathBuf::from("./config/my-env.json"))
320328
);
321329
}
322-
_ => panic!("Expected Template action"),
330+
crate::presentation::cli::CreateAction::Environment { .. } => {
331+
panic!("Expected Template action")
332+
}
323333
},
324334
Commands::Destroy { .. } => panic!("Expected Create command"),
325335
}

src/presentation/commands/create/errors.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,10 @@ Example valid configuration:
150150
For more information, see the configuration documentation."
151151
}
152152
},
153-
Self::ConfigValidationFailed(inner) => inner.help(),
153+
Self::ConfigValidationFailed(inner) | Self::TemplateGenerationFailed(inner) => {
154+
inner.help()
155+
}
154156
Self::CommandFailed(inner) => inner.help(),
155-
Self::TemplateGenerationFailed(inner) => inner.help(),
156157
}
157158
}
158159
}

0 commit comments

Comments
 (0)