]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Clippy, better error message
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 30 Oct 2025 08:30:11 +0000 (09:30 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 4 Nov 2025 12:40:38 +0000 (13:40 +0100)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/recursordist/rec-rust-lib/rust/src/bridge.rs

index aecfdd05d53b432c69f8cd5cdcd302e00bbe2a54..3d4a3f1fc5b23203a613415bbc28fe1c12cfeebf 100644 (file)
@@ -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)