Skip to content

Commit 63b2e43

Browse files
authored
Merge pull request #86 from rust-mobile/ci-fmt
ci: Run `cargo fmt --check` to ensure code is always properly formatted
2 parents 151aefc + 3b37c64 commit 63b2e43

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/ci.yml

+5
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,14 @@ jobs:
3434
with:
3535
toolchain: ${{ matrix.toolchain }}
3636
target: ${{ matrix.target }}
37+
components: rustfmt, clippy
3738

39+
- run: cargo fmt --check
40+
- run: cargo clippy --target=${{ matrix.target }} -- -Dwarnings
3841
- run: cargo build --target=${{ matrix.target }}
3942
- run: cargo doc --target=${{ matrix.target }}
43+
env:
44+
RUSTDOCFLAGS: -Dwarnings
4045
# Temporary test non-target only.
4146
# TODO: Test in emulator or something.
4247
- run: cargo test

src/config.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ impl fmt::Debug for Config {
2020
.field("buf_id", &self.buf_id)
2121
.field("filter", &self.filter)
2222
.field("tag", &self.tag)
23-
.field("custom_format", match &self.custom_format {
24-
Some(_) => &"Some(_)",
25-
None => &"None",
26-
})
23+
.field(
24+
"custom_format",
25+
match &self.custom_format {
26+
Some(_) => &"Some(_)",
27+
None => &"None",
28+
},
29+
)
2730
.finish()
2831
}
2932
}

0 commit comments

Comments
 (0)