Skip to content

Commit ca13697

Browse files
committed
rustfmt travis
1 parent 31d2081 commit ca13697

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
@@ -50,6 +50,11 @@ main() {
5050
return
5151
fi
5252

53+
if [ $VENDOR = rustfmt ]; then
54+
cargo fmt --all -- --check
55+
return
56+
fi
57+
5358
cargo build --target $TARGET --release
5459

5560
case $TRAVIS_OS_NAME in

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)