Skip to content

Commit 82d2b49

Browse files
committed
clippy fix
1 parent 6a9a0f5 commit 82d2b49

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](https://semver.org/).
77

88
## [Unreleased]
9+
910
- Fix dangling implicit derives
1011

1112
## [v0.28.0] - 2022-12-25

src/generate/device.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result<Toke
151151
let array_proxy = include_str!("array_proxy.rs");
152152
if config.generic_mod {
153153
let mut file = File::create(config.output_dir.join("generic.rs"))?;
154-
writeln!(file, "{}", generic_file)?;
154+
writeln!(file, "{generic_file}")?;
155155
if config.atomics {
156-
writeln!(file, "\n{}", generic_atomic_file)?;
156+
writeln!(file, "\n{generic_atomic_file}")?;
157157
}
158158
if config.const_generic {
159-
writeln!(file, "{}", array_proxy)?;
159+
writeln!(file, "{array_proxy}")?;
160160
}
161161

162162
if !config.make_mod {

src/generate/interrupt.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pub fn render(
115115
match target {
116116
Target::CortexM => {
117117
for name in &names {
118-
writeln!(device_x, "PROVIDE({} = DefaultHandler);", name)?;
118+
writeln!(device_x, "PROVIDE({name} = DefaultHandler);")?;
119119
}
120120

121121
root.extend(quote! {
@@ -141,7 +141,7 @@ pub fn render(
141141
}
142142
Target::Msp430 => {
143143
for name in &names {
144-
writeln!(device_x, "PROVIDE({} = DefaultHandler);", name).unwrap();
144+
writeln!(device_x, "PROVIDE({name} = DefaultHandler);").unwrap();
145145
}
146146

147147
root.extend(quote! {
@@ -169,7 +169,7 @@ pub fn render(
169169
}
170170
Target::RISCV => {
171171
for name in &names {
172-
writeln!(device_x, "PROVIDE({} = DefaultHandler);", name)?;
172+
writeln!(device_x, "PROVIDE({name} = DefaultHandler);")?;
173173
}
174174

175175
root.extend(quote! {
@@ -194,7 +194,7 @@ pub fn render(
194194
}
195195
Target::XtensaLX => {
196196
for name in &names {
197-
writeln!(device_x, "PROVIDE({} = DefaultHandler);", name)?;
197+
writeln!(device_x, "PROVIDE({name} = DefaultHandler);")?;
198198
}
199199

200200
root.extend(quote! {

src/generate/register.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ pub fn render_register_mod(
318318

319319
let methods = methods
320320
.iter()
321-
.map(|s| format!("[`{0}`](crate::generic::Reg::{0})", s))
321+
.map(|s| format!("[`{s}`](crate::generic::Reg::{s})"))
322322
.collect::<Vec<_>>();
323323
let mut doc = format!("{description}\n\nThis register you can {}. See [API](https://docs.rs/svd2rust/#read--modify--write-api).", methods.join(", "));
324324

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ fn run() -> Result<()> {
223223
]
224224
.contains(&config.target)
225225
{
226-
writeln!(File::create(path.join("device.x"))?, "{}", device_x)?;
226+
writeln!(File::create(path.join("device.x"))?, "{device_x}")?;
227227
writeln!(File::create(path.join("build.rs"))?, "{}", build_rs())?;
228228
}
229229

0 commit comments

Comments
 (0)