Skip to content

Commit 397a4ef

Browse files
authored
Merge pull request #4 from bitshifter/clippy-fix
Fix clippy warnings in tests.
2 parents b29a305 + 1130ba7 commit 397a4ef

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,20 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18+
1819
- uses: actions/checkout@v4
20+
21+
- run: rustup update --no-self-update stable
22+
- run: rustup default stable
23+
1924
- name: fmt
2025
run: cargo fmt -- --check --color always
26+
2127
- name: clippy
22-
run: cargo clippy --no-deps
28+
run: cargo clippy --no-deps --all-targets -- -D warnings
29+
2330
- name: check
2431
run: cargo check
32+
2533
- name: test
2634
run: cargo test

tests/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn setup_test_dir() -> Result<TempDir> {
3030

3131
// Initialize git repo (codegen requires a git repository)
3232
Command::new("git")
33-
.args(&["init"])
33+
.args(["init"])
3434
.current_dir(dir.path())
3535
.assert()
3636
.success();
@@ -83,7 +83,7 @@ fn test_generate_files() -> Result<()> {
8383

8484
// Run codegen binary directly with --config flag
8585
let mut cmd = Command::cargo_bin("codegen")?;
86-
cmd.args(&["--config", config_path.to_str().unwrap()]);
86+
cmd.args(["--config", config_path.to_str().unwrap()]);
8787

8888
cmd.assert().success();
8989

@@ -111,12 +111,12 @@ fn test_check_mode() -> Result<()> {
111111

112112
// First generate the file
113113
let mut cmd = Command::cargo_bin("codegen")?;
114-
cmd.args(&["--config", config_path.to_str().unwrap()]);
114+
cmd.args(["--config", config_path.to_str().unwrap()]);
115115
cmd.assert().success();
116116

117117
// Run codegen in check mode with matching files
118118
let mut cmd = Command::cargo_bin("codegen")?;
119-
cmd.args(&["--config", config_path.to_str().unwrap(), "--check"]);
119+
cmd.args(["--config", config_path.to_str().unwrap(), "--check"]);
120120
cmd.assert().success();
121121

122122
// Now modify the generated file to have different content
@@ -125,7 +125,7 @@ fn test_check_mode() -> Result<()> {
125125

126126
// Run codegen in check mode
127127
let mut cmd = Command::cargo_bin("codegen")?;
128-
cmd.args(&["--config", config_path.to_str().unwrap(), "--check"]);
128+
cmd.args(["--config", config_path.to_str().unwrap(), "--check"]);
129129

130130
cmd.assert().failure();
131131

@@ -171,7 +171,7 @@ fn test_multiple_templates() -> Result<()> {
171171

172172
// Run codegen and check that all files are generated
173173
let mut cmd = Command::cargo_bin("codegen")?;
174-
cmd.args(&["--config", config_path.to_str().unwrap()]);
174+
cmd.args(["--config", config_path.to_str().unwrap()]);
175175
cmd.assert().success();
176176

177177
assert_snapshot!(std::fs::read_to_string(
@@ -210,7 +210,7 @@ fn test_error_missing_properties() -> Result<()> {
210210

211211
// Run codegen and check that it fails with an error
212212
let mut cmd = Command::cargo_bin("codegen")?;
213-
cmd.args(&["--config", config_path.to_str().unwrap()]);
213+
cmd.args(["--config", config_path.to_str().unwrap()]);
214214

215215
cmd.assert().failure();
216216

0 commit comments

Comments
 (0)