Skip to content

Commit ede59d8

Browse files
authored
Try #411:
2 parents 31d2081 + 104e2a6 commit ede59d8

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ env:
1010

1111
matrix:
1212
include:
13+
# rustfmt
14+
- env: TARGET=x86_64-unknown-linux-gnu VENDOR=rustfmt
15+
rust: stable
16+
1317
# Nightly, for testing
1418
- env: TARGET=x86_64-unknown-linux-gnu VENDOR=Atmel
1519

ci/script.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ test_svd_for_target() {
3535
}
3636

3737
main() {
38+
if [ $VENDOR = rustfmt ]; then
39+
cargo fmt --all -- --check
40+
return
41+
fi
42+
3843
# Ensure that `cargo test` works to avoid surprising people, though it
3944
# doesn't help with our actual coverage.
4045
cargo test

src/generate/device.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
use crate::svd::Device;
2+
use proc_macro2::{Ident, Span, TokenStream};
13
use quote::ToTokens;
2-
use proc_macro2::{TokenStream, Ident, Span};
34
use std::fs::File;
45
use std::io::Write;
5-
use crate::svd::Device;
66

77
use crate::errors::*;
88
use crate::util::{self, ToSanitizedUpperCase};
@@ -124,8 +124,7 @@ pub fn render(
124124

125125
let core_peripherals: &[_] = if fpu_present {
126126
&[
127-
"CBP", "CPUID", "DCB", "DWT", "FPB", "FPU", "ITM", "MPU", "NVIC", "SCB", "SYST",
128-
"TPIU",
127+
"CBP", "CPUID", "DCB", "DWT", "FPB", "FPU", "ITM", "MPU", "NVIC", "SCB", "SYST", "TPIU",
129128
]
130129
} else {
131130
&[
@@ -181,7 +180,12 @@ pub fn render(
181180
continue;
182181
}
183182

184-
out.extend(peripheral::render(p, &d.peripherals, &d.default_register_properties, nightly)?);
183+
out.extend(peripheral::render(
184+
p,
185+
&d.peripherals,
186+
&d.default_register_properties,
187+
nightly,
188+
)?);
185189

186190
if p.registers
187191
.as_ref()

0 commit comments

Comments
 (0)