From 185c785f4181882e39346c2436eebfee0e52cc84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Thu, 17 Jul 2025 14:27:55 +0200 Subject: [PATCH 1/2] Fix typo --- src/patch/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/patch/mod.rs b/src/patch/mod.rs index 4fb6d44..be72a0b 100644 --- a/src/patch/mod.rs +++ b/src/patch/mod.rs @@ -226,7 +226,7 @@ fn update_dict(parent: &mut Hash, child: &Hash) -> Result<()> { if let Entry::Occupied(mut e) = parent.entry(key.clone()) { match e.get_mut() { el if el == val => { - println!("In {key:?}: dublicate rule {val:?}, ignored"); + println!("In {key:?}: duplicate rule {val:?}, ignored"); } Yaml::Array(a) => match val { Yaml::Array(val) => { @@ -236,7 +236,7 @@ fn update_dict(parent: &mut Hash, child: &Hash) -> Result<()> { if !a.contains(val) { a.push(val.clone()); } else { - println!("In {key:?}: dublicate rule {val:?}, ignored"); + println!("In {key:?}: duplicate rule {val:?}, ignored"); } } _ => {} @@ -251,7 +251,7 @@ fn update_dict(parent: &mut Hash, child: &Hash) -> Result<()> { a.insert(0, s.clone()); e.insert(Yaml::Array(a)); } else { - println!("In {key:?}: dublicate rule {s:?}, ignored"); + println!("In {key:?}: duplicate rule {s:?}, ignored"); } } s2 if matches!(s2, Yaml::String(_)) => { From 6b5d683b1a4fcaac1419b4911a435064dcb83375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Mon, 11 Aug 2025 08:06:54 +0200 Subject: [PATCH 2/2] Fix clippy --- src/cli.rs | 2 +- src/html/html_cli.rs | 6 +++--- src/patch/iterators.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 0db90b3..3bce171 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -248,7 +248,7 @@ pub fn run() { .run() .with_context(|| format!("by svdtools ({})", clap::crate_version!())) { - log::error!("{:?}", e); + log::error!("{e:?}"); std::process::exit(1); } diff --git a/src/html/html_cli.rs b/src/html/html_cli.rs index 970bd79..110523c 100644 --- a/src/html/html_cli.rs +++ b/src/html/html_cli.rs @@ -122,7 +122,7 @@ fn short_ra(ra: Option) -> &'static str { trait GetI64 { fn get_i64(&self, key: &str) -> Option; - fn get_str(&self, key: &str) -> Option>; + fn get_str(&self, key: &str) -> Option>; } impl GetI64 for Object { @@ -131,7 +131,7 @@ impl GetI64 for Object { .and_then(|v| v.as_view().as_scalar()) .and_then(|s| s.to_integer()) } - fn get_str(&self, key: &str) -> Option> { + fn get_str(&self, key: &str) -> Option> { self.get(key) .and_then(|v| v.as_view().as_scalar()) .map(|s| s.into_cow_str()) @@ -508,7 +508,7 @@ fn parse_device(svdfile: impl AsRef) -> anyhow::Result { fn process_svd(svdfile: impl AsRef) -> anyhow::Result { let svdfile = svdfile.as_ref().to_str().unwrap(); - println!("Processing {}", svdfile); + println!("Processing {svdfile}"); parse_device(svdfile).with_context(|| format!("In file {svdfile}")) } diff --git a/src/patch/iterators.rs b/src/patch/iterators.rs index 0697662..4775d8b 100644 --- a/src/patch/iterators.rs +++ b/src/patch/iterators.rs @@ -29,7 +29,7 @@ where Self: Iterator + Sized, Self::Item: Name, { - fn matched(self, spec: &str) -> MatchIter; + fn matched(self, spec: &str) -> MatchIter<'_, Self>; } impl Matched for I @@ -37,7 +37,7 @@ where Self: Iterator + Sized, Self::Item: Name, { - fn matched(self, spec: &str) -> MatchIter { + fn matched(self, spec: &str) -> MatchIter<'_, Self> { MatchIter { it: self, spec } } }