Skip to content

Commit

Permalink
Merge #709
Browse files Browse the repository at this point in the history
709: clippy fix r=Emilgardis a=burrbull



Co-authored-by: Andrey Zgarbul <[email protected]>
  • Loading branch information
bors[bot] and burrbull authored Jan 29, 2023
2 parents 6a9a0f5 + b46c23f commit f1295c4
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- { rust: stable, vendor: Toshiba, options: all }
- { rust: stable, vendor: Toshiba, options: "" }
# Test MSRV
- { rust: 1.61.0, vendor: Nordic, options: "" }
- { rust: 1.64.0, vendor: Nordic, options: "" }
# Use nightly for architectures which don't support stable
- { rust: nightly, vendor: MSP430, options: "--atomics" }
- { rust: nightly, vendor: MSP430, options: "" }
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/)
and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

- Bump MSRV to 1.64
- Fix dangling implicit derives

## [v0.28.0] - 2022-12-25
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ This project is developed and maintained by the [Tools team][team].

## Minimum Supported Rust Version (MSRV)

The **generated code** is guaranteed to compile on stable Rust 1.61.0 and up.
The **generated code** is guaranteed to compile on stable Rust 1.64.0 and up.

If you encounter compilation errors on any stable version newer than 1.61.0, please open an issue.
If you encounter compilation errors on any stable version newer than 1.64.0, please open an issue.

# Testing Locally

Expand Down
6 changes: 3 additions & 3 deletions src/generate/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result<Toke
let array_proxy = include_str!("array_proxy.rs");
if config.generic_mod {
let mut file = File::create(config.output_dir.join("generic.rs"))?;
writeln!(file, "{}", generic_file)?;
writeln!(file, "{generic_file}")?;
if config.atomics {
writeln!(file, "\n{}", generic_atomic_file)?;
writeln!(file, "\n{generic_atomic_file}")?;
}
if config.const_generic {
writeln!(file, "{}", array_proxy)?;
writeln!(file, "{array_proxy}")?;
}

if !config.make_mod {
Expand Down
8 changes: 4 additions & 4 deletions src/generate/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ pub fn render(
match target {
Target::CortexM => {
for name in &names {
writeln!(device_x, "PROVIDE({} = DefaultHandler);", name)?;
writeln!(device_x, "PROVIDE({name} = DefaultHandler);")?;
}

root.extend(quote! {
Expand All @@ -141,7 +141,7 @@ pub fn render(
}
Target::Msp430 => {
for name in &names {
writeln!(device_x, "PROVIDE({} = DefaultHandler);", name).unwrap();
writeln!(device_x, "PROVIDE({name} = DefaultHandler);").unwrap();
}

root.extend(quote! {
Expand Down Expand Up @@ -169,7 +169,7 @@ pub fn render(
}
Target::RISCV => {
for name in &names {
writeln!(device_x, "PROVIDE({} = DefaultHandler);", name)?;
writeln!(device_x, "PROVIDE({name} = DefaultHandler);")?;
}

root.extend(quote! {
Expand All @@ -194,7 +194,7 @@ pub fn render(
}
Target::XtensaLX => {
for name in &names {
writeln!(device_x, "PROVIDE({} = DefaultHandler);", name)?;
writeln!(device_x, "PROVIDE({name} = DefaultHandler);")?;
}

root.extend(quote! {
Expand Down
2 changes: 1 addition & 1 deletion src/generate/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ pub fn render_register_mod(

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

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ fn run() -> Result<()> {
]
.contains(&config.target)
{
writeln!(File::create(path.join("device.x"))?, "{}", device_x)?;
writeln!(File::create(path.join("device.x"))?, "{device_x}")?;
writeln!(File::create(path.join("build.rs"))?, "{}", build_rs())?;
}

Expand Down

0 comments on commit f1295c4

Please sign in to comment.