From c7f097920218a3bdaa2fdcb74a790813e6c31a84 Mon Sep 17 00:00:00 2001 From: Robert Vojta Date: Wed, 20 Nov 2019 10:31:58 +0100 Subject: [PATCH 1/4] Use 2018 edition for rustfmt Signed-off-by: Robert Vojta --- rustfmt.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/rustfmt.toml b/rustfmt.toml index cba0d885c..c699603f5 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,3 +1,4 @@ hard_tabs = true max_width = 120 use_small_heuristics = "Max" +edition = "2018" From 2ace6cef8a40e0788f153e517941bd7ef3ee6ddb Mon Sep 17 00:00:00 2001 From: Robert Vojta Date: Wed, 20 Nov 2019 11:16:45 +0100 Subject: [PATCH 2/4] Run rustfmt check in the script stage after_script exit codes are ignored and do not affect build status. Signed-off-by: Robert Vojta --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2d48dc81b..7357a4a20 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ matrix: rust: stable before_script: - rustup component add rustfmt - after_script: + script: - cargo fmt -- --check - os: linux rust: beta From a1bf57dd4ccdc0e8330b24eb7810c2b38463166b Mon Sep 17 00:00:00 2001 From: Robert Vojta Date: Wed, 20 Nov 2019 12:04:54 +0100 Subject: [PATCH 3/4] Fix ethbloom formatting Signed-off-by: Robert Vojta --- ethbloom/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethbloom/src/lib.rs b/ethbloom/src/lib.rs index d21f62022..9ef11e3ee 100644 --- a/ethbloom/src/lib.rs +++ b/ethbloom/src/lib.rs @@ -93,7 +93,7 @@ impl<'a> From> for Hash<'a> { keccak256.update(raw); keccak256.finalize(&mut out); Hash::Owned(out) - }, + } Input::Hash(hash) => Hash::Ref(hash), } } From b1449768b13ae84b03b9279e35a0f05c6ac36cef Mon Sep 17 00:00:00 2001 From: Robert Vojta Date: Wed, 20 Nov 2019 13:15:32 +0100 Subject: [PATCH 4/4] Move cargo fmt from matrix to script Signed-off-by: Robert Vojta --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7357a4a20..c0471b8df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,6 @@ matrix: rust: stable before_script: - rustup component add rustfmt - script: - - cargo fmt -- --check - os: linux rust: beta - os: linux @@ -22,6 +20,9 @@ matrix: install: - curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh script: + - if [ "$TRAVIS_RUST_VERSION" == "stable" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then + cargo fmt -- --check; + fi - cargo check --all --tests - cargo build --all - cargo test --all --exclude uint --exclude fixed-hash