aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan McIntyre <me@mciantyre.dev>2025-08-03 07:20:01 -0400
committerIan McIntyre <me@mciantyre.dev>2025-08-03 07:22:19 -0400
commit19946bde2f691f26f8e6623a5e08b101ca9309dc (patch)
treeb636c913b0b4fed4455171eb17393de5941929a0
parent9e05e2f97a5a411cc8e3e111e0d24d4abae1c76c (diff)
Fix clippy warnings
-rw-r--r--src/host.rs7
-rw-r--r--tests/inspect_elf.rs33
2 files changed, 15 insertions, 25 deletions
diff --git a/src/host.rs b/src/host.rs
index e8325a7..f301711 100644
--- a/src/host.rs
+++ b/src/host.rs
@@ -121,7 +121,7 @@ impl Display for Memory {
/// Define an alias for `name` that maps to a memory block named `placement`.
fn region_alias(output: &mut dyn Write, name: &str, placement: Memory) -> io::Result<()> {
- writeln!(output, "REGION_ALIAS(\"REGION_{}\", {});", name, placement)
+ writeln!(output, "REGION_ALIAS(\"REGION_{name}\", {placement});")
}
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -664,7 +664,7 @@ impl RuntimeBuilder {
fn prevent_flash(name: &str, memory: Memory) -> Result<(), String> {
if memory == Memory::Flash {
- Err(format!("Section '{}' cannot be placed in flash", name))
+ Err(format!("Section '{name}' cannot be placed in flash"))
} else {
Ok(())
}
@@ -771,8 +771,7 @@ fn write_ram_memory_map(
) -> io::Result<()> {
writeln!(
output,
- "/* Memory map for '{:?}' that executes from RAM. */",
- family,
+ "/* Memory map for '{family:?}' that executes from RAM. */",
)?;
writeln!(output, "MEMORY {{")?;
write_flexram_memories(output, family, flexram_banks)?;
diff --git a/tests/inspect_elf.rs b/tests/inspect_elf.rs
index 3576385..8108f3f 100644
--- a/tests/inspect_elf.rs
+++ b/tests/inspect_elf.rs
@@ -15,9 +15,9 @@ fn cargo_build_with_envs(board: &str, envs: &[(&str, &str)]) -> Result<PathBuf>
let status = Command::new("cargo")
.arg("build")
.arg("--example=blink-rtic")
- .arg(format!("--features=board/{},board/rtic", board))
+ .arg(format!("--features=board/{board},board/rtic"))
.arg("--target=thumbv7em-none-eabihf")
- .arg(format!("--target-dir=target/{}", board))
+ .arg(format!("--target-dir=target/{board}"))
.arg("--quiet")
.envs(envs.iter().copied())
.spawn()?
@@ -25,16 +25,13 @@ fn cargo_build_with_envs(board: &str, envs: &[(&str, &str)]) -> Result<PathBuf>
// TODO(summivox): `ExitStatus::exit_ok()` stabilization (can be chained after the `.wait()?)
if !status.success() {
- return Err(format!(
- "Building board '{}' failed: process returned {:?}",
- board, status,
- )
- .into());
+ return Err(
+ format!("Building board '{board}' failed: process returned {status:?}",).into(),
+ );
}
let path = PathBuf::from(format!(
- "target/{}/thumbv7em-none-eabihf/debug/examples/blink-rtic",
- board
+ "target/{board}/thumbv7em-none-eabihf/debug/examples/blink-rtic"
));
Ok(path)
}
@@ -43,28 +40,22 @@ fn cargo_build_nonboot(board: &str) -> Result<PathBuf> {
let status = Command::new("cargo")
.arg("build")
.arg("--example=blink-rtic")
- .arg(format!(
- "--features=board/{},board/rtic,board/nonboot",
- board
- ))
+ .arg(format!("--features=board/{board},board/rtic,board/nonboot"))
.arg("--target=thumbv7em-none-eabihf")
- .arg(format!("--target-dir=target/{}-nonboot", board))
+ .arg(format!("--target-dir=target/{board}-nonboot"))
.arg("--quiet")
.spawn()?
.wait()?;
// TODO(summivox): `ExitStatus::exit_ok()` stabilization (can be chained after the `.wait()?)
if !status.success() {
- return Err(format!(
- "Building board '{}' failed: process returned {:?}",
- board, status,
- )
- .into());
+ return Err(
+ format!("Building board '{board}' failed: process returned {status:?}",).into(),
+ );
}
let path = PathBuf::from(format!(
- "target/{}-nonboot/thumbv7em-none-eabihf/debug/examples/blink-rtic",
- board
+ "target/{board}-nonboot/thumbv7em-none-eabihf/debug/examples/blink-rtic"
));
Ok(path)
}