Skip to content

Commit 715970b

Browse files
committed
Make BootConfig non-exhaustive
1 parent ef110a3 commit 715970b

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

common/config/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};
55
/// Configures the boot behavior of the bootloader.
66
#[derive(Serialize, Deserialize)]
77
#[serde(default)]
8+
#[non_exhaustive]
89
pub struct BootConfig {
910
/// Configuration for the frame buffer setup.
1011
pub frame_buffer: FrameBuffer,

tests/config_file.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@ fn default_config() {
1313

1414
#[test]
1515
fn custom_boot_config() {
16-
let config = BootConfig {
17-
frame_buffer: Default::default(),
18-
log_level: Default::default(),
19-
frame_buffer_logging: false,
20-
serial_logging: true,
21-
_test_sentinel: 0xb001b001b001,
22-
};
16+
let mut config = BootConfig::default();
17+
config.frame_buffer_logging = false;
18+
config.serial_logging = true;
19+
config._test_sentinel = 0xb001b001b001;
2320
run_test_kernel_internal(
2421
env!("CARGO_BIN_FILE_TEST_KERNEL_CONFIG_FILE_custom_config"),
2522
None,

0 commit comments

Comments
 (0)