Skip to content

Commit 2a5b47f

Browse files
committed
provisioning: Ensure we're creating errors for the right things
Signed-off-by: Ikey Doherty <[email protected]>
1 parent e57748d commit 2a5b47f

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

crates/provisioning/src/commands.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ type CommandExec = for<'a> fn(Context<'a>) -> Result<Command, crate::Error>;
3232

3333
/// Map of command names to functions
3434
static COMMANDS: phf::Map<&'static str, CommandExec> = phf::phf_map! {
35-
// "find-disk" => dummy_command,
36-
// "create-partition" => dummy_command,
37-
// "create-partition-table" => dummy_command,
35+
"find-disk" => dummy_command,
36+
"create-partition" => dummy_command,
37+
"create-partition-table" => dummy_command,
3838
};
3939

4040
/// Parse a command from a node if possible

crates/provisioning/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,9 @@ impl Parser {
9898
Err(e) => Either::Right(e),
9999
});
100100

101-
let fatal_errors = errors.iter().filter(|e| match e.severity().unwrap_or(Severity::Error) {
102-
Severity::Error => true,
103-
_ => true,
104-
});
101+
let fatal_errors = errors
102+
.iter()
103+
.filter(|e| matches!(e.severity().unwrap_or(Severity::Error), Severity::Error));
105104

106105
// If we have any fatal errors, bail out
107106
// TODO: Add an error sink to allow bubbling up of warnings/diagnostics

0 commit comments

Comments
 (0)