Skip to content

Commit c814e46

Browse files
authored
Making test config field optional. (#928)
1 parent 6344b5c commit c814e46

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

core/sdk/src/api/manifest/ripple_manifest_loader.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ pub struct RippleManifestConfig {
3838
}
3939

4040
#[derive(Clone, Debug, Deserialize, Default)]
41+
#[serde(default)]
4142
struct DefaultManifestConfig {
4243
device: String,
4344
extn: String,
4445
tag: Option<String>,
45-
test_device: String,
46-
test_extn: String,
46+
test_device: Option<String>,
47+
test_extn: Option<String>,
4748
}
4849

4950
#[derive(Clone, Debug, Deserialize, Default)]
@@ -354,13 +355,17 @@ impl RippleConfigLoader {
354355
};
355356

356357
let test_path = if is_extn {
357-
self.manifest_config.default.test_extn.as_str()
358+
self.manifest_config.default.test_extn.as_deref()
358359
} else {
359-
self.manifest_config.default.test_device.as_str()
360+
self.manifest_config.default.test_device.as_deref()
360361
};
361362

362-
let test_path_resolved = if !test_path.is_empty() {
363-
Some(self.resolve_path(test_path))
363+
let test_path_resolved = if let Some(path) = test_path {
364+
if !path.is_empty() {
365+
Some(self.resolve_path(path))
366+
} else {
367+
None
368+
}
364369
} else {
365370
None
366371
};

0 commit comments

Comments
 (0)