summaryrefslogtreecommitdiffstats
path: root/src/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/config')
-rw-r--r--src/config/mod.rs28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 5edf78b..c8bfa9f 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -376,12 +376,12 @@ impl Settings {
if let Some(url) = &self.mycelium_rest_url {
url::Url::parse(url).with_context(|| format!("mycelium-rest-url {url:?}"))?;
}
- if self.mycelium_rest_url.is_some() {
- if let Some((name, _)) = self.supervised_only().iter().find(|(_, set)| *set) {
- bail!(
- "{name} is for a supervised Mycelium daemon and can't be combined with mycelium-rest-url"
- );
- }
+ if self.mycelium_rest_url.is_some()
+ && let Some((name, _)) = self.supervised_only().iter().find(|(_, set)| *set)
+ {
+ bail!(
+ "{name} is for a supervised Mycelium daemon and can't be combined with mycelium-rest-url"
+ );
}
// A private network has both; one alone would be ignored or invented.
if self.mycelium_network_key_file.is_some() != self.mycelium_network_name.is_some() {
@@ -585,16 +585,12 @@ pub(crate) fn overlay(layer: &mut Layer, name: String, entry: Entry, how: Overla
let earlier = layer
.get(other)
.is_some_and(|previous| previous.origin.provenance != entry.origin.provenance);
- if earlier {
- if let Some(previous) = layer.remove(other) {
- log(
- &format!(
- "{name} can't be combined with {other}; dropped the earlier value"
- ),
- other,
- &previous,
- );
- }
+ if earlier && let Some(previous) = layer.remove(other) {
+ log(
+ &format!("{name} can't be combined with {other}; dropped the earlier value"),
+ other,
+ &previous,
+ );
}
}
}