From 6e6b2b84fe76172fe24c086017a1d13bcff5f38f Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 4 Feb 2020 14:52:25 +0000 Subject: [PATCH] scripts: Check the Rust formatting is valid Check the rust formatting rather than just reformatting code on the CI agent. Also fix a formatting error that slipped in whilst the cargo fmt check was not working correctly. Signed-off-by: Rob Bradford --- scripts/run_cargo_tests.sh | 2 +- src/main.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/run_cargo_tests.sh b/scripts/run_cargo_tests.sh index aed76ae93..da6f24abf 100755 --- a/scripts/run_cargo_tests.sh +++ b/scripts/run_cargo_tests.sh @@ -24,5 +24,5 @@ time cargo rustc --bin vhost_user_net --no-default-features --features "pci" -- time cargo clippy --all-targets --no-default-features --features "mmio" -- -D warnings time cargo rustc --bin cloud-hypervisor --no-default-features --features "mmio" -- -D warnings time cargo rustc --bin vhost_user_net --no-default-features --features "mmio" -- -D warnings -time cargo fmt +time cargo fmt -- --check time cargo build --release diff --git a/src/main.rs b/src/main.rs index 3e6ab8db5..44f61c4d2 100755 --- a/src/main.rs +++ b/src/main.rs @@ -57,7 +57,8 @@ impl log::Log for Logger { record.target(), record.args() ) - }.ok(); + } + .ok(); } fn flush(&self) {} }