From f69fdc00f3d0344f98c733846ae2fb695f092e8d Mon Sep 17 00:00:00 2001 From: Dylan McKay Date: Fri, 17 Nov 2017 17:12:50 +1300 Subject: [PATCH] Convert underscores to dashes in pinout names Fixes #7. --- build.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 4015d59..4c58f38 100644 --- a/build.rs +++ b/build.rs @@ -120,9 +120,10 @@ mod gen { writeln!(w, "//! | | Pinout | Mcuage | Operating temperature | Operating voltage | Max speed |")?; writeln!(w, "//! |--------|--------|---------|-----------------------|-------------------|-----------|")?; for variant in mcu.variants.iter() { + let pinout_label = variant.pinout.as_ref().map(|p| p.replace('_', "-").to_owned()).unwrap_or_else(|| String::new()); let speed_mhz = variant.speed_max_hz / 1_000_000; writeln!(w, "//! | {} | {} | {} | {}°C - {}°C | {}V - {}V | {} MHz |", - variant.name, variant.pinout.clone().unwrap_or_else(|| String::new()), + variant.name, pinout_label, variant.package, variant.temperature_min, variant.temperature_max, variant.voltage_min, variant.voltage_max, speed_mhz)?;