Skip to content

Commit 48d7b80

Browse files
committed
Make BuildKernelError and CreateBootimageError non-exhaustive
1 parent 211415d commit 48d7b80

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/builder.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ pub enum BuildKernelError {
326326
},
327327
XbuildJsonOutputInvalidUtf8(std::string::FromUtf8Error),
328328
XbuildJsonOutputInvalidJson(json::Error),
329+
#[doc(hidden)]
330+
__NonExhaustive,
329331
}
330332

331333
impl fmt::Display for BuildKernelError {
@@ -350,6 +352,7 @@ impl fmt::Display for BuildKernelError {
350352
BuildKernelError::XbuildJsonOutputInvalidJson(err) => {
351353
writeln!(f, "Output of kernel build with --message-format=json is not valid JSON:\n{}", err)
352354
}
355+
BuildKernelError::__NonExhaustive => panic!("__NonExhaustive variant constructed"),
353356
}
354357
}
355358
}
@@ -385,6 +388,8 @@ pub enum CreateBootimageError {
385388
},
386389
XbuildJsonOutputInvalidUtf8(std::string::FromUtf8Error),
387390
XbuildJsonOutputInvalidJson(json::Error),
391+
#[doc(hidden)]
392+
__NonExhaustive,
388393
}
389394

390395
impl fmt::Display for CreateBootimageError {
@@ -443,6 +448,7 @@ impl fmt::Display for CreateBootimageError {
443448
"Output of bootloader build with --message-format=json is not valid JSON:\n{}",
444449
err
445450
),
451+
CreateBootimageError::__NonExhaustive => panic!("__NonExhaustive variant constructed"),
446452
}
447453
}
448454
}

0 commit comments

Comments
 (0)