Skip to content

Commit 0ad6714

Browse files
authored
Merge pull request #292 from bugadani/patch-1
Fix typo & clippy
2 parents 6ebab74 + 6b5d683 commit 0ad6714

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ pub fn run() {
248248
.run()
249249
.with_context(|| format!("by svdtools ({})", clap::crate_version!()))
250250
{
251-
log::error!("{:?}", e);
251+
log::error!("{e:?}");
252252

253253
std::process::exit(1);
254254
}

src/html/html_cli.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ fn short_ra(ra: Option<ReadAction>) -> &'static str {
122122

123123
trait GetI64 {
124124
fn get_i64(&self, key: &str) -> Option<i64>;
125-
fn get_str(&self, key: &str) -> Option<Cow<str>>;
125+
fn get_str(&self, key: &str) -> Option<Cow<'_, str>>;
126126
}
127127

128128
impl GetI64 for Object {
@@ -131,7 +131,7 @@ impl GetI64 for Object {
131131
.and_then(|v| v.as_view().as_scalar())
132132
.and_then(|s| s.to_integer())
133133
}
134-
fn get_str(&self, key: &str) -> Option<Cow<str>> {
134+
fn get_str(&self, key: &str) -> Option<Cow<'_, str>> {
135135
self.get(key)
136136
.and_then(|v| v.as_view().as_scalar())
137137
.map(|s| s.into_cow_str())
@@ -508,7 +508,7 @@ fn parse_device(svdfile: impl AsRef<Path>) -> anyhow::Result<Object> {
508508

509509
fn process_svd(svdfile: impl AsRef<Path>) -> anyhow::Result<Object> {
510510
let svdfile = svdfile.as_ref().to_str().unwrap();
511-
println!("Processing {}", svdfile);
511+
println!("Processing {svdfile}");
512512
parse_device(svdfile).with_context(|| format!("In file {svdfile}"))
513513
}
514514

src/patch/iterators.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ where
2929
Self: Iterator + Sized,
3030
Self::Item: Name,
3131
{
32-
fn matched(self, spec: &str) -> MatchIter<Self>;
32+
fn matched(self, spec: &str) -> MatchIter<'_, Self>;
3333
}
3434

3535
impl<I> Matched for I
3636
where
3737
Self: Iterator + Sized,
3838
Self::Item: Name,
3939
{
40-
fn matched(self, spec: &str) -> MatchIter<Self> {
40+
fn matched(self, spec: &str) -> MatchIter<'_, Self> {
4141
MatchIter { it: self, spec }
4242
}
4343
}

src/patch/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ fn update_dict(parent: &mut Hash, child: &Hash) -> Result<()> {
226226
if let Entry::Occupied(mut e) = parent.entry(key.clone()) {
227227
match e.get_mut() {
228228
el if el == val => {
229-
println!("In {key:?}: dublicate rule {val:?}, ignored");
229+
println!("In {key:?}: duplicate rule {val:?}, ignored");
230230
}
231231
Yaml::Array(a) => match val {
232232
Yaml::Array(val) => {
@@ -236,7 +236,7 @@ fn update_dict(parent: &mut Hash, child: &Hash) -> Result<()> {
236236
if !a.contains(val) {
237237
a.push(val.clone());
238238
} else {
239-
println!("In {key:?}: dublicate rule {val:?}, ignored");
239+
println!("In {key:?}: duplicate rule {val:?}, ignored");
240240
}
241241
}
242242
_ => {}
@@ -251,7 +251,7 @@ fn update_dict(parent: &mut Hash, child: &Hash) -> Result<()> {
251251
a.insert(0, s.clone());
252252
e.insert(Yaml::Array(a));
253253
} else {
254-
println!("In {key:?}: dublicate rule {s:?}, ignored");
254+
println!("In {key:?}: duplicate rule {s:?}, ignored");
255255
}
256256
}
257257
s2 if matches!(s2, Yaml::String(_)) => {

0 commit comments

Comments
 (0)