Skip to content

Commit 1373b00

Browse files
Merge pull request #2407 from didier-wenzek/improve/add_include_localcleansession_setting
Use default(variable = "AutoFlag::Auto")
2 parents 5dcb430 + 614f472 commit 1373b00

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

crates/common/tedge_config/src/tedge_config_cli/models/auto.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,6 @@ pub struct InvalidAutoFlag {
1717
input: String,
1818
}
1919

20-
impl From<bool> for AutoFlag {
21-
fn from(value: bool) -> Self {
22-
if value {
23-
AutoFlag::True
24-
} else {
25-
AutoFlag::False
26-
}
27-
}
28-
}
29-
30-
impl From<&str> for AutoFlag {
31-
fn from(value: &str) -> Self {
32-
FromStr::from_str(value).unwrap_or(AutoFlag::False)
33-
}
34-
}
35-
3620
impl FromStr for AutoFlag {
3721
type Err = InvalidAutoFlag;
3822

crates/common/tedge_config/src/tedge_config_cli/tedge_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ define_tedge_config! {
403403
include: {
404404
/// Set the bridge local clean session flag (this requires mosquitto >= 2.0.0)
405405
#[tedge_config(note = "If set to 'auto', this cleans the local session accordingly the detected version of mosquitto.")]
406-
#[tedge_config(example = "auto", default(value = "auto"))]
406+
#[tedge_config(example = "auto", default(variable = "AutoFlag::Auto"))]
407407
local_cleansession: AutoFlag,
408408
}
409409
},

0 commit comments

Comments
 (0)