Skip to content

Commit

Permalink
CI cargo clippy deny warnings for benches
Browse files Browse the repository at this point in the history
  • Loading branch information
SpriteOvO committed Jun 12, 2024
1 parent ada02cb commit 214f40b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,20 @@ jobs:
- name: Install dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo bash ./.github/workflows/install-deps.sh
- name: Install Rust nightly
- name: Install Rust nightly (stable date version)
run: |
rustup toolchain install nightly
rustup component add clippy --toolchain nightly
STABLE_DATE=$(cargo clippy --version | perl -ne 'print $& if /\b\d{4}-\d{2}-\d{2}\b/')
echo "STABLE_DATE=$STABLE_DATE" >> $GITHUB_ENV
rustup toolchain install nightly-$STABLE_DATE
rustup component add clippy --toolchain nightly-$STABLE_DATE
- name: Restore cargo caches
uses: Swatinem/rust-cache@v1
- name: Run clippy
run: cargo clippy --all-features --tests --examples -- -D warnings
- name: Run clippy nightly for benches
run: cargo +nightly clippy --all-features --benches
run: |
cargo +nightly-${{ env.STABLE_DATE }} clippy --all-features --benches -- -D warnings
check:
strategy:
Expand Down
1 change: 1 addition & 0 deletions spdlog/benches/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use std::{

use once_cell::sync::Lazy;

#[allow(dead_code)]
pub static BENCH_LOGS_PATH: Lazy<PathBuf> = Lazy::new(|| {
let path = Path::new(env!("OUT_DIR")).join("bench_logs");
if !path.exists() {
Expand Down
2 changes: 1 addition & 1 deletion spdlog/benches/spdlog-rs/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{cell::RefCell, sync::Arc};

use paste::paste;
use spdlog::{
formatter::{pattern, Formatter, FullFormatter, Pattern, PatternFormatter, RuntimePattern},
formatter::{pattern, Formatter, FullFormatter, Pattern, PatternFormatter},
prelude::*,
sink::Sink,
Record, StringBuf,
Expand Down

0 comments on commit 214f40b

Please sign in to comment.