Skip to content

Commit 76c1dc2

Browse files
Merge branch 'main' into fork/robgjansen/attr
2 parents 047d4a4 + aed364f commit 76c1dc2

File tree

3 files changed

+39
-5
lines changed

3 files changed

+39
-5
lines changed

.github/workflows/rust.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Install latest stable
20+
uses: actions-rs/toolchain@v1
21+
with:
22+
toolchain: stable
23+
override: true
24+
components: rustfmt, clippy
25+
- name: Build
26+
run: cargo build
27+
- name: Fmt
28+
run: cargo fmt --check
29+
- name: Run tests
30+
run: cargo test --examples

examples/readme/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,3 @@ mod tests {
6565
test_each_file! { in "./examples/readme/duplicate_names/" => empty}
6666
}
6767
}
68-

src/lib.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#![doc = include_str!("../README.md")]
22
use proc_macro2::{Ident, Span, TokenStream};
33
use quote::{format_ident, quote};
4-
use syn::token::Async;
54
use std::collections::{HashMap, HashSet};
65
use std::ffi::OsString;
76
use std::path::{Path, PathBuf};
87
use syn::parse::{Parse, ParseStream};
98
use syn::punctuated::Punctuated;
9+
use syn::token::Async;
1010
use syn::{bracketed, parse_macro_input, Expr, LitStr, Meta, Token};
1111
use unicode_ident::{is_xid_continue, is_xid_start};
1212

@@ -56,7 +56,7 @@ impl Parse for TestEachArgs {
5656
abort!(async_span, "Expected at least one attribute (e.g., `#[tokio::test]`) when `async` is given.");
5757
}
5858
Some(token)
59-
},
59+
}
6060
Err(_) => None,
6161
};
6262

@@ -241,11 +241,16 @@ fn generate_from_tree(
241241
file.push(".");
242242
file.push(extension);
243243
let file: PathBuf = file.into();
244-
244+
245245
// Canonicalize the file path
246246
let input = match file.canonicalize() {
247247
Ok(path) => path,
248-
Err(e) => return Err(format!("Failed to read expected file {}.{extension}: {e}", file.display())),
248+
Err(e) => {
249+
return Err(format!(
250+
"Failed to read expected file {}.{extension}: {e}",
251+
file.display()
252+
))
253+
}
249254
};
250255
let input = input.to_str().unwrap();
251256

0 commit comments

Comments
 (0)