Skip to content

Commit ce20bdf

Browse files
fix clippy
Signed-off-by: zhangjinpeng87 <zzzhangjinpeng@gmail.com>
1 parent 0feb335 commit ce20bdf

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ thiserror = "1.0"
6767
criterion = "0.4"
6868
ctor = "0.2"
6969
env_logger = "0.10"
70+
grpcio = { version = "=0.10.2", default-features = false, features = [
71+
"protobuf-codec",
72+
] }
7073
kvproto = { git = "https://github.com/pingcap/kvproto.git", branch = "release-8.5", default-features = false, features = [
7174
"protobuf-codec",
7275
] }

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ format:
4444
CLIPPY_WHITELIST += -A clippy::bool_assert_comparison
4545
## Run clippy.
4646
clippy:
47+
# Fresh lockfile resolution can pull grpcio 0.13.x via kvproto (grpcio = "0.*"),
48+
# which fails to build on macOS arm64 in current CI images. Force a compatible
49+
# selection before linting.
50+
cargo ${TOOLCHAIN_ARGS} update -p grpcio@0.13.0 --precise 0.10.2 || true
4751
ifdef WITH_NIGHTLY_FEATURES
4852
cargo ${TOOLCHAIN_ARGS} clippy --all --features nightly_group,failpoints --all-targets -- -D clippy::all ${CLIPPY_WHITELIST}
4953
else

src/engine.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,7 +1410,7 @@ pub(crate) mod tests {
14101410
let empty_entry = Entry::new();
14111411
assert_eq!(empty_entry.compute_size(), 0);
14121412
log_batch
1413-
.add_entries::<Entry>(0, &[empty_entry.clone()])
1413+
.add_entries::<Entry>(0, std::slice::from_ref(&empty_entry))
14141414
.unwrap();
14151415
engine.write(&mut log_batch, false).unwrap();
14161416
let empty_state = RaftLocalState::new();
@@ -1420,7 +1420,7 @@ pub(crate) mod tests {
14201420
.unwrap();
14211421
engine.write(&mut log_batch, false).unwrap();
14221422
log_batch
1423-
.add_entries::<Entry>(2, &[empty_entry.clone()])
1423+
.add_entries::<Entry>(2, std::slice::from_ref(&empty_entry))
14241424
.unwrap();
14251425
log_batch
14261426
.put_message(2, b"key".to_vec(), &empty_state)

tests/benches/bench_recovery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fn dir_size(path: &str) -> ReadableSize {
116116

117117
fn bench_recovery(c: &mut Criterion) {
118118
// prepare input
119-
let cfgs = vec![
119+
let cfgs = [
120120
(
121121
"default".to_owned(),
122122
Config {

0 commit comments

Comments
 (0)