Skip to content

Commit c1ee931

Browse files
authored
chore: use Rust 1.97 cargo warnings (#47)
- [x] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/master/CODE_OF_CONDUCT.md). ~- [ ] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.~ ---
1 parent 7702972 commit c1ee931

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

justfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ binstall_args := if env('CI', '') != '' {'--no-confirm --no-track --disable-tele
88
# location of the coverage output, used by CI
99
coverage_lcov := 'target/llvm-cov/lcov.info'
1010

11-
# if running in CI, treat warnings as errors by setting RUSTFLAGS and RUSTDOCFLAGS to '-D warnings' unless they are already set
11+
# if running in CI, treat warnings as errors by setting CARGO_BUILD_WARNINGS to 'deny' unless it is already set
1212
# Use `CI=true just ci-test` to run the same tests as in GitHub CI.
13-
# Use `just env-info` to see the current values of RUSTFLAGS and RUSTDOCFLAGS
13+
# Use `just env-info` to see the current value of CARGO_BUILD_WARNINGS
1414
ci_mode := if env('CI', '') != '' {'1'} else {''}
15-
export RUSTFLAGS := env('RUSTFLAGS', if ci_mode == '1' {'-D warnings'} else {''})
16-
export RUSTDOCFLAGS := env('RUSTDOCFLAGS', if ci_mode == '1' {'-D warnings'} else {''})
15+
export CARGO_BUILD_WARNINGS := env('CARGO_BUILD_WARNINGS', if ci_mode == '1' {'deny'} else {'warn'})
1716
export RUST_BACKTRACE := env('RUST_BACKTRACE', if ci_mode == '1' {'1'} else {'0'})
1817

1918
@_default:
@@ -75,8 +74,7 @@ env-info:
7574
rustc --version
7675
cargo --version
7776
rustup --version
78-
@echo "RUSTFLAGS='$RUSTFLAGS'"
79-
@echo "RUSTDOCFLAGS='$RUSTDOCFLAGS'"
77+
@echo "CARGO_BUILD_WARNINGS='$CARGO_BUILD_WARNINGS'"
8078
@echo "RUST_BACKTRACE='$RUST_BACKTRACE'"
8179

8280
# Reformat all code `cargo fmt`. If nightly is available, use it for better results
@@ -170,6 +168,7 @@ assert-git-is-clean:
170168
cargo-install $COMMAND $INSTALL_CMD='' *args='':
171169
#!/usr/bin/env bash
172170
set -euo pipefail
171+
unset CARGO_BUILD_WARNINGS
173172
if ! command -v $COMMAND > /dev/null; then
174173
echo "$COMMAND could not be found. Installing..."
175174
if ! command -v cargo-binstall > /dev/null; then

0 commit comments

Comments
 (0)