Skip to content

Commit 2108921

Browse files
committed
tests: Use ..Default::default() for install config
To make adding a new field not require touching all the tests. Signed-off-by: Colin Walters <[email protected]>
1 parent fd94c6f commit 2108921

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/src/install/config.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ root-fs-type = "xfs"
177177
let other = InstallConfigurationToplevel {
178178
install: Some(InstallConfiguration {
179179
root_fs_type: Some(Filesystem::Ext4),
180-
filesystem: None,
181-
kargs: None,
180+
..Default::default()
182181
}),
183182
};
184183
install.merge(other.install.unwrap());
@@ -206,14 +205,13 @@ kargs = ["console=ttyS0", "foo=bar"]
206205
assert_eq!(install.root_fs_type.unwrap(), Filesystem::Ext4);
207206
let other = InstallConfigurationToplevel {
208207
install: Some(InstallConfiguration {
209-
root_fs_type: None,
210-
filesystem: None,
211208
kargs: Some(
212209
["console=tty0", "nosmt"]
213210
.into_iter()
214211
.map(ToOwned::to_owned)
215212
.collect(),
216213
),
214+
..Default::default()
217215
}),
218216
};
219217
install.merge(other.install.unwrap());
@@ -245,13 +243,12 @@ type = "xfs"
245243
);
246244
let other = InstallConfigurationToplevel {
247245
install: Some(InstallConfiguration {
248-
root_fs_type: None,
249246
filesystem: Some(BasicFilesystems {
250247
root: Some(RootFS {
251248
fstype: Some(Filesystem::Ext4),
252249
}),
253250
}),
254-
kargs: None,
251+
..Default::default()
255252
}),
256253
};
257254
install.merge(other.install.unwrap());

0 commit comments

Comments
 (0)