diff options
| author | tv <tv@krebsco.de> | 2026-10-26 21:56:20 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-26 21:56:20 +0100 |
| commit | 08f5df1f0a2e22876a5b49a4f9e2e05a61df882a (patch) | |
| tree | 113050df0bef5e8f3e9d188c69fc2a0c76d2eb17 /src/config/mod.rs | |
| parent | ecdb3ee944f5c171faac3a71117e2ff27e064295 (diff) | |
make clippy happy again
Diffstat (limited to 'src/config/mod.rs')
| -rw-r--r-- | src/config/mod.rs | 28 |
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, + ); } } } |
