Skip to content

Commit aed364f

Browse files
Merge pull request #12 from binary-banter/JonathanBrouwer-patch-1
Create rust.yml
2 parents 622d703 + e0e61e1 commit aed364f

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
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: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,16 @@ fn generate_from_tree(
209209
file.push(".");
210210
file.push(extension);
211211
let file: PathBuf = file.into();
212-
212+
213213
// Canonicalize the file path
214214
let input = match file.canonicalize() {
215215
Ok(path) => path,
216-
Err(e) => return Err(format!("Failed to read expected file {}.{extension}: {e}", file.display())),
216+
Err(e) => {
217+
return Err(format!(
218+
"Failed to read expected file {}.{extension}: {e}",
219+
file.display()
220+
))
221+
}
217222
};
218223
let input = input.to_str().unwrap();
219224

0 commit comments

Comments
 (0)