Skip to content

Commit 214f40b

Browse files
committed
CI cargo clippy deny warnings for benches
1 parent ada02cb commit 214f40b

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.github/workflows/ci.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,20 @@ jobs:
7777
- name: Install dependencies
7878
if: matrix.os == 'ubuntu-latest'
7979
run: sudo bash ./.github/workflows/install-deps.sh
80-
- name: Install Rust nightly
80+
- name: Install Rust nightly (stable date version)
8181
run: |
82-
rustup toolchain install nightly
83-
rustup component add clippy --toolchain nightly
82+
STABLE_DATE=$(cargo clippy --version | perl -ne 'print $& if /\b\d{4}-\d{2}-\d{2}\b/')
83+
echo "STABLE_DATE=$STABLE_DATE" >> $GITHUB_ENV
84+
85+
rustup toolchain install nightly-$STABLE_DATE
86+
rustup component add clippy --toolchain nightly-$STABLE_DATE
8487
- name: Restore cargo caches
8588
uses: Swatinem/rust-cache@v1
8689
- name: Run clippy
8790
run: cargo clippy --all-features --tests --examples -- -D warnings
8891
- name: Run clippy nightly for benches
89-
run: cargo +nightly clippy --all-features --benches
92+
run: |
93+
cargo +nightly-${{ env.STABLE_DATE }} clippy --all-features --benches -- -D warnings
9094
9195
check:
9296
strategy:

spdlog/benches/common/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use std::{
99

1010
use once_cell::sync::Lazy;
1111

12+
#[allow(dead_code)]
1213
pub static BENCH_LOGS_PATH: Lazy<PathBuf> = Lazy::new(|| {
1314
let path = Path::new(env!("OUT_DIR")).join("bench_logs");
1415
if !path.exists() {

spdlog/benches/spdlog-rs/pattern.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::{cell::RefCell, sync::Arc};
66

77
use paste::paste;
88
use spdlog::{
9-
formatter::{pattern, Formatter, FullFormatter, Pattern, PatternFormatter, RuntimePattern},
9+
formatter::{pattern, Formatter, FullFormatter, Pattern, PatternFormatter},
1010
prelude::*,
1111
sink::Sink,
1212
Record, StringBuf,

0 commit comments

Comments
 (0)