From: Otto Moerbeek Date: Thu, 30 Oct 2025 08:30:11 +0000 (+0100) Subject: Clippy, better error message X-Git-Tag: rec-5.4.0-alpha1~108^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3dc370718cff091aa3fa6fce085e8c0ff6a743d;p=thirdparty%2Fpdns.git Clippy, better error message Signed-off-by: Otto Moerbeek --- diff --git a/pdns/recursordist/rec-rust-lib/rust/src/bridge.rs b/pdns/recursordist/rec-rust-lib/rust/src/bridge.rs index aecfdd05d5..3d4a3f1fc5 100644 --- a/pdns/recursordist/rec-rust-lib/rust/src/bridge.rs +++ b/pdns/recursordist/rec-rust-lib/rust/src/bridge.rs @@ -990,7 +990,7 @@ impl Recursorsettings { } fn buildnestedmaps(field: &[String], leaf: &serde_yaml::Value) -> serde_yaml::Value { - if field.len() == 0 { + if field.is_empty() { return leaf.clone(); } let submap = Self::buildnestedmaps(&field[1..], leaf); @@ -1018,7 +1018,8 @@ impl Recursorsettings { Ok(value) => { let map = Self::buildnestedmaps(field, &value); let res = serde_yaml::to_string(&map).unwrap(); - let msg = format!("# {}: not explicitly set, default value(s) listed below:\n{}", field[0], res); + let name = field.join("."); + let msg = format!("# {}: not explicitly set, default value(s) listed below:\n{}", name, res); Ok(msg) }, Err(x) => Err(x)