Skip to content

Commit 53e06f8

Browse files
committed
clippy
1 parent b6b0633 commit 53e06f8

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

src/interrupts/interrupts_cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ fn print_interrupts(interrupt_list: &[InterruptWithPeriph]) {
4242
fn print_gaps(gaps: &[u32]) {
4343
let gaps: Vec<String> = gaps.iter().map(|g| g.to_string()).collect();
4444
let gaps_str = gaps.join(", ");
45-
println!("Gaps: {}", gaps_str);
45+
println!("Gaps: {gaps_str}");
4646
}

src/makedeps/makedeps_cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn write_to_file(file: &mut File, string_to_write: &str) -> Result<()> {
1515

1616
fn write_file(file_name: &Path, deps: Vec<PathBuf>) -> Result<()> {
1717
// Open a file in write-only mode
18-
let mut file = File::create(&file_name)?;
18+
let mut file = File::create(file_name)?;
1919

2020
let file_name = format!("{}:", file_name.file_name().unwrap().to_str().unwrap());
2121
write_to_file(&mut file, &file_name)?;

src/mmap/mmap_cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub fn parse_device(svd_file: &Path) -> Result<()> {
1414
Err(e).with_context(|| format!("Parsing {path_str}"))
1515
}
1616
Ok(text) => {
17-
println!("{}", text);
17+
println!("{text}");
1818
Ok(())
1919
}
2020
}

src/patch/mod.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn update_dict(parent: &mut Hash, child: &Hash) -> Result<()> {
128128
if let Entry::Occupied(mut e) = parent.entry(key.clone()) {
129129
match e.get_mut() {
130130
el if el == val => {
131-
println!("In {:?}: dublicate rule {:?}, ignored", key, val);
131+
println!("In {key:?}: dublicate rule {val:?}, ignored");
132132
}
133133
Yaml::Array(a) => match val {
134134
Yaml::Array(val) => {
@@ -138,7 +138,7 @@ fn update_dict(parent: &mut Hash, child: &Hash) -> Result<()> {
138138
if !a.contains(val) {
139139
a.push(val.clone());
140140
} else {
141-
println!("In {:?}: dublicate rule {:?}, ignored", key, val);
141+
println!("In {key:?}: dublicate rule {val:?}, ignored");
142142
}
143143
}
144144
_ => {}
@@ -153,14 +153,11 @@ fn update_dict(parent: &mut Hash, child: &Hash) -> Result<()> {
153153
a.insert(0, s.clone());
154154
e.insert(Yaml::Array(a));
155155
} else {
156-
println!("In {:?}: dublicate rule {:?}, ignored", key, s);
156+
println!("In {key:?}: dublicate rule {s:?}, ignored");
157157
}
158158
}
159159
s2 if matches!(s2, Yaml::String(_)) => {
160-
println!(
161-
"In {:?}: conflicting rules {:?} and {:?}, ignored",
162-
key, s, s2
163-
);
160+
println!("In {key:?}: conflicting rules {s:?} and {s2:?}, ignored");
164161
}
165162
_ => {}
166163
},

0 commit comments

Comments
 (0)