Skip to content

Commit

Permalink
Merge pull request #2407 from didier-wenzek/improve/add_include_local…
Browse files Browse the repository at this point in the history
…cleansession_setting

Use default(variable = "AutoFlag::Auto")
  • Loading branch information
didier-wenzek authored Nov 6, 2023
2 parents 5dcb430 + 614f472 commit 1373b00
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
16 changes: 0 additions & 16 deletions crates/common/tedge_config/src/tedge_config_cli/models/auto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,6 @@ pub struct InvalidAutoFlag {
input: String,
}

impl From<bool> for AutoFlag {
fn from(value: bool) -> Self {
if value {
AutoFlag::True
} else {
AutoFlag::False
}
}
}

impl From<&str> for AutoFlag {
fn from(value: &str) -> Self {
FromStr::from_str(value).unwrap_or(AutoFlag::False)
}
}

impl FromStr for AutoFlag {
type Err = InvalidAutoFlag;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ define_tedge_config! {
include: {
/// Set the bridge local clean session flag (this requires mosquitto >= 2.0.0)
#[tedge_config(note = "If set to 'auto', this cleans the local session accordingly the detected version of mosquitto.")]
#[tedge_config(example = "auto", default(value = "auto"))]
#[tedge_config(example = "auto", default(variable = "AutoFlag::Auto"))]
local_cleansession: AutoFlag,
}
},
Expand Down

1 comment on commit 1373b00

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
356 0 3 356 100 1h15m43.578s

Please sign in to comment.