Skip to content

Commit d012bf1

Browse files
committed
fixup: riscv-rt: clippy fixes
1 parent 1c1cc91 commit d012bf1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

riscv-rt/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3232
- Now, `_default_abort` is 4-byte aligned (required by `_pre_init_trap`)
3333
- Removed `.init.trap` section, as it is no longer required.
3434

35+
### Fixed
36+
37+
- `clippy` fixes
38+
3539
## [v0.14.0] - 2025-02-18
3640

3741
### Changed

riscv-rt/macros/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream {
6262
}
6363

6464
fn check_correct_type(argument: &PatType, ty: &str) -> Option<TokenStream> {
65-
let inv_type_message = format!("argument type must be {}", ty);
65+
let inv_type_message = format!("argument type must be {ty}");
6666

6767
if !is_correct_type(&argument.ty, ty) {
6868
let error = parse::Error::new(argument.ty.span(), inv_type_message);
@@ -305,7 +305,7 @@ pub fn loop_asm(input: TokenStream) -> TokenStream {
305305
.map(|i| {
306306
let i = i.to_string();
307307
let asm = args.asm_template.replace("{}", &i);
308-
format!("core::arch::asm!(\"{}\");", asm)
308+
format!("core::arch::asm!(\"{asm}\");")
309309
})
310310
.collect::<Vec<String>>()
311311
.join("\n");
@@ -346,7 +346,7 @@ pub fn loop_global_asm(input: TokenStream) -> TokenStream {
346346
.collect::<Vec<String>>()
347347
.join("\n");
348348

349-
let res = format!("core::arch::global_asm!(\n\"{}\"\n);", instructions);
349+
let res = format!("core::arch::global_asm!(\n\"{instructions}\"\n);");
350350
res.parse().unwrap()
351351
}
352352

@@ -728,7 +728,7 @@ fn trap(
728728

729729
let int_path = parse_macro_input!(args as Path);
730730
let int_ident = &int_path.segments.last().unwrap().ident;
731-
let export_name = format!("{:#}", int_ident);
731+
let export_name = format!("{int_ident:#}");
732732

733733
let start_trap = match arch {
734734
Some(arch) => {

0 commit comments

Comments
 (0)