Skip to content

Commit a4aee71

Browse files
committed
feat: use cargo script
see rust-lang/rfcs#3424 (comment)
1 parent a9a271a commit a4aee71

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

.github/scripts/rust/lint.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
//! ```cargo
2-
//! [dependencies]
3-
//! serde = {version = "*", features = ["derive"]}
4-
//! toml = {version = "*", features = ["parse"]}
5-
//! ```
1+
#!/usr/bin/env -S cargo +nightly -Zscript
2+
```cargo
3+
[dependencies]
4+
serde = {version = "*", features = ["derive"]}
5+
toml = {version = "*", features = ["parse"]}
6+
```
67

78
#![allow(non_snake_case)]
89

.justfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ install-cargo-hack:
110110
install-cargo-nextest:
111111
@just install-cargo-tool 'cargo nextest' cargo-nextest 0.9.37
112112

113-
[private]
114-
install-rust-script:
115-
@just install-cargo-tool 'rust-script' rust-script 0.23.0
116-
117113
[private]
118114
install-llvm-cov:
119115
@just install-cargo-tool 'cargo llvm-cov' cargo-llvm-cov 0.5.9
@@ -131,7 +127,7 @@ install-cargo-insta:
131127
[private]
132128
[no-cd]
133129
lint-toml mode:
134-
@rust-script "{{repo}}/.github/scripts/rust/lint.rs" {{mode}} `cargo metadata --no-deps --format-version 1 | jq '.workspace_root' -r`
130+
@cargo run --manifest-path "{{repo}}/.github/scripts/rust/lint.rs" {{mode}} `cargo metadata --no-deps --format-version 1 | jq '.workspace_root' -r`
135131

136132
# Runs all linting commands and fails if the CI would fail
137133
[no-cd]

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)