Skip to content

Commit 2ab5da1

Browse files
committed
ci: Add a check for formatting, apply cargo fmt
1 parent d83ae23 commit 2ab5da1

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

.github/workflows/main.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,22 @@ jobs:
2121
- name: Install Rust
2222
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
2323
- run: cargo test
24+
25+
doc_fmt:
26+
name: Document and check formatting
27+
runs-on: ubuntu-24.04
28+
steps:
29+
- uses: actions/checkout@master
30+
- name: Install Rust
31+
run: |
32+
rustup update nightly
33+
rustup default nightly
34+
rustup component add rustfmt
2435
- run: cargo doc
36+
- run: cargo fmt --check
2537

2638
msrv:
27-
runs-on: ubuntu-latest
39+
runs-on: ubuntu-24.04
2840
steps:
2941
- uses: actions/checkout@master
3042
- name: Install Rust

src/tests/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ fn test_free_trailing_only() {
248248

249249
#[test]
250250
fn test_free_trailing_args() {
251-
let args = vec!["pre".to_owned(), "--".to_owned(), "post".to_owned() ];
251+
let args = vec!["pre".to_owned(), "--".to_owned(), "post".to_owned()];
252252
match Options::new().parse(&args) {
253253
Ok(ref m) => {
254254
assert_eq!(m.free_trailing_start(), Some(1));
@@ -741,10 +741,7 @@ fn test_multi() {
741741
);
742742

743743
assert_eq!(matches_both.opts_str_first(&["e"]).unwrap(), "foo");
744-
assert_eq!(
745-
matches_both.opts_str_first(&["encrypt"]).unwrap(),
746-
"bar"
747-
);
744+
assert_eq!(matches_both.opts_str_first(&["encrypt"]).unwrap(), "bar");
748745
assert_eq!(
749746
matches_both.opts_str_first(&["e", "encrypt"]).unwrap(),
750747
"foo"

0 commit comments

Comments
 (0)