Skip to content

Commit bfff12a

Browse files
Update rust toolchain to nightly-2021-04-15 (tikv#10023)
* Update rust toolchain to nightly-2021-03-25 Signed-off-by: Andy Lok <[email protected]> * Fix cliipy Signed-off-by: Andy Lok <[email protected]> * address comment Signed-off-by: Andy Lok <[email protected]> * update to nightly-2021-04-15 Signed-off-by: Andy Lok <[email protected]> * format Signed-off-by: Andy Lok <[email protected]> * fix ci Signed-off-by: Andy Lok <[email protected]> * fix ci Signed-off-by: Andy Lok <[email protected]> * address comment Signed-off-by: Andy Lok <[email protected]> * address comment Signed-off-by: Andy Lok <[email protected]> * fix plugin segment fault Signed-off-by: Andy Lok <[email protected]> Co-authored-by: Ti Chi Robot <[email protected]>
1 parent c6926ba commit bfff12a

File tree

72 files changed

+208
-259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+208
-259
lines changed

Cargo.lock

Lines changed: 13 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ test_sst_importer = { path = "components/test_sst_importer", default-features =
219219
test_util = { path = "components/test_util", default-features = false }
220220
tokio = { version = "0.2", features = ["macros", "rt-threaded", "time"] }
221221
zipf = "6.1.0"
222-
example_plugin = { path = "components/test_coprocessor_plugin/example_plugin" }
223222

224223
[patch.crates-io]
225224
# TODO: remove this when new raft-rs is published.

cmd/tikv-ctl/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2381,7 +2381,7 @@ fn compact_whole_cluster(
23812381
let mgr = Arc::clone(&mgr);
23822382
let addr = s.address.clone();
23832383
let (from, to) = (from.clone(), to.clone());
2384-
let cfs: Vec<String> = cfs.iter().map(|cf| (*cf).to_string()).collect();
2384+
let cfs: Vec<String> = cfs.iter().map(|cf| cf.to_string()).collect();
23852385
let h = thread::Builder::new()
23862386
.name(format!("compact-{}", addr))
23872387
.spawn(move || {

components/cdc/src/endpoint.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -885,10 +885,7 @@ impl<T: 'static + RaftStoreRouter<RocksEngine>> Endpoint<T> {
885885
})
886886
.collect();
887887
let resps = futures::future::join_all(regions).await;
888-
resps
889-
.into_iter()
890-
.filter_map(|resp| resp)
891-
.collect::<Vec<u64>>()
888+
resps.into_iter().flatten().collect::<Vec<u64>>()
892889
}
893890

894891
async fn region_resolved_ts_store(
@@ -1387,8 +1384,8 @@ impl Initializer {
13871384

13881385
if let Some(resolver) = resolver {
13891386
// Track the locks.
1390-
for entry in &entries {
1391-
if let Some(TxnEntry::Prewrite { lock, .. }) = entry {
1387+
for entry in entries.iter().flatten() {
1388+
if let TxnEntry::Prewrite { lock, .. } = entry {
13921389
let (encoded_key, value) = lock;
13931390
let key = Key::from_encoded_slice(encoded_key).into_raw().unwrap();
13941391
let lock = Lock::parse(value)?;

components/cdc/tests/integrations/test_cdc.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -968,11 +968,10 @@ fn test_old_value_multi_changefeeds() {
968968
if row.get_type() == EventLogType::Prewrite {
969969
if row.get_start_ts() == ts3.into_inner() {
970970
assert_eq!(row.get_old_value(), b"v1");
971-
event_count += 1;
972971
} else {
973972
assert_eq!(row.get_old_value(), b"");
974-
event_count += 1;
975973
}
974+
event_count += 1;
976975
}
977976
}
978977
}

components/cdc/tests/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub fn new_event_feed(
5454
let mut events;
5555
{
5656
let mut event_feed = event_feed_wrap_clone.lock().unwrap();
57-
events = (*event_feed).take();
57+
events = event_feed.take();
5858
}
5959
let events_rx = if let Some(events_rx) = events.as_mut() {
6060
events_rx

components/coprocessor_plugin_api/src/util.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ pub type PluginConstructorSignature =
2222
#[macro_export]
2323
macro_rules! declare_plugin {
2424
($plugin_ctor:expr) => {
25+
#[cfg(not(test))]
2526
#[global_allocator]
2627
static HOST_ALLOCATOR: $crate::allocator::HostAllocator =
2728
$crate::allocator::HostAllocator::new();
2829

30+
#[cfg(not(test))]
2931
#[no_mangle]
3032
pub unsafe extern "C" fn _plugin_create(
3133
host_allocator: $crate::allocator::HostAllocatorPtr,

components/encryption/src/crypter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ mod tests {
249249
assert_eq!(ivs.len(), 100);
250250

251251
for iv in ivs {
252-
let iv1 = Iv::from_slice(&iv.as_slice()[..]).unwrap();
252+
let iv1 = Iv::from_slice(iv.as_slice()).unwrap();
253253
assert_eq!(iv.as_slice(), iv1.as_slice());
254254
}
255255
}

components/encryption/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub type Result<T> = result::Result<T, Error>;
7373
impl ErrorCodeExt for Error {
7474
fn error_code(&self) -> ErrorCode {
7575
match self {
76-
Error::RetryCodedError(err) => (*err).error_code(),
76+
Error::RetryCodedError(err) => err.error_code(),
7777
Error::TailRecordParseIncomplete => error_code::encryption::PARSE_INCOMPLETE,
7878
Error::Rocks(_) => error_code::encryption::ROCKS,
7979
Error::Io(_) => error_code::encryption::IO,

components/engine_rocks/src/raw_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ pub(crate) fn db_exist(path: &str) -> bool {
202202
/// Returns a Vec of cf which is in `a' but not in `b'.
203203
fn cfs_diff<'a>(a: &[&'a str], b: &[&str]) -> Vec<&'a str> {
204204
a.iter()
205-
.filter(|x| b.iter().find(|y| y == x).is_none())
205+
.filter(|x| !b.iter().any(|y| *x == y))
206206
.cloned()
207207
.collect()
208208
}

0 commit comments

Comments
 (0)