Skip to content

Commit d7f6ab4

Browse files
authored
Merge branch 'master' into mingley/tso-waker-criterion
2 parents 87fc66b + e53837d commit d7f6ab4

13 files changed

Lines changed: 21 additions & 15 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ authors = ["The TiKV Project Authors"]
77
repository = "https://github.com/tikv/client-rust"
88
description = "The Rust language implementation of TiKV client."
99
edition = "2021"
10+
rust-version = "1.93.0"
1011

1112
[features]
1213
default = ["prometheus"]

OWNERS_ALIASES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ aliases:
3030
- nolouch
3131
- rleungx
3232
- tier-cap
33+
- wfxr
3334
- wjhuang2016
3435
- wshwsh12
3536
sig-community-approvers:

examples/raw.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright 2018 TiKV Project Authors. Licensed under Apache-2.0.
22

33
#![type_length_limit = "8165158"]
4+
#![allow(clippy::result_large_err)]
45

56
mod common;
67

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.84.1"
2+
channel = "1.93.0"
33
components = ["rustfmt", "clippy"]

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
//! ```
9292
9393
#![allow(clippy::field_reassign_with_default)]
94+
#![allow(clippy::result_large_err)]
9495

9596
pub mod backoff;
9697
#[doc(hidden)]

src/pd/retry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl RetryClientTrait for RetryClient<Cluster> {
184184
cluster
185185
.get_all_stores(self.timeout)
186186
.await
187-
.map(|resp| resp.stores.into_iter().map(Into::into).collect())
187+
.map(|resp| resp.stores)
188188
})
189189
}
190190

src/proto.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
pub use protos::*;
77

8+
// Rust 1.93's clippy::all flags many protobuf-generated wire types as dead code.
9+
// Prior toolchain (1.84.1) did not fail on these generated definitions.
810
#[allow(clippy::doc_lazy_continuation)]
11+
#[allow(dead_code)]
912
mod protos {
1013
include!("generated/mod.rs");
1114
}

src/store/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ macro_rules! impl_request {
4242
.$fun(req)
4343
.await
4444
.map(|r| Box::new(r.into_inner()) as Box<dyn Any>)
45-
.map_err(Error::GrpcAPI)
45+
.map_err(Error::from)
4646
}
4747

4848
fn label(&self) -> &'static str {

src/transaction/requests.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,8 @@ pub fn new_pessimistic_prewrite_request(
241241
let len = mutations.len();
242242
let mut req = new_prewrite_request(mutations, primary_lock, start_version, lock_ttl);
243243
req.for_update_ts = for_update_ts;
244-
req.pessimistic_actions = iter::repeat(PessimisticAction::DoPessimisticCheck.into())
245-
.take(len)
246-
.collect();
244+
req.pessimistic_actions =
245+
iter::repeat_n(PessimisticAction::DoPessimisticCheck.into(), len).collect();
247246
req
248247
}
249248

@@ -343,7 +342,7 @@ impl Shardable for kvrpcpb::CommitRequest {
343342
}
344343

345344
fn apply_shard(&mut self, shard: Self::Shard) {
346-
self.keys = shard.into_iter().map(Into::into).collect();
345+
self.keys = shard;
347346
}
348347

349348
fn apply_store(&mut self, store: &RegionStore) -> Result<()> {
@@ -570,7 +569,7 @@ impl Merge<kvrpcpb::ScanLockResponse> for Collect {
570569
fn merge(&self, input: Vec<Result<kvrpcpb::ScanLockResponse>>) -> Result<Self::Out> {
571570
input
572571
.into_iter()
573-
.flat_map_ok(|mut resp| resp.take_locks().into_iter().map(Into::into))
572+
.flat_map_ok(|mut resp| resp.take_locks().into_iter())
574573
.collect()
575574
}
576575
}

src/transaction/transaction.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,7 @@ impl<PdC: PdClient> Transaction<PdC> {
283283
.retry_multi_region(retry_options.region_backoff)
284284
.merge(Collect)
285285
.plan();
286-
plan.execute()
287-
.await
288-
.map(|r| r.into_iter().map(Into::into).collect())
286+
plan.execute().await.map(|r| r.into_iter().collect())
289287
})
290288
.await
291289
.map(move |pairs| pairs.map(move |pair| pair.truncate_keyspace(keyspace)))
@@ -806,9 +804,7 @@ impl<PdC: PdClient> Transaction<PdC> {
806804
.retry_multi_region(retry_options.region_backoff)
807805
.merge(Collect)
808806
.plan();
809-
plan.execute()
810-
.await
811-
.map(|r| r.into_iter().map(Into::into).collect())
807+
plan.execute().await.map(|r| r.into_iter().collect())
812808
},
813809
)
814810
.await
@@ -1470,6 +1466,7 @@ impl<PdC: PdClient> Committer<PdC> {
14701466
// Truncate mutation to a new length as `percent/100`.
14711467
// Return error when truncate to zero.
14721468
let fp = || -> Result<usize> {
1469+
#[allow(unused_mut)]
14731470
let mut new_len = mutations_len;
14741471
fail_point!("before-commit-secondary", |percent| {
14751472
let percent = percent.unwrap().parse::<usize>().unwrap();

0 commit comments

Comments
 (0)