Skip to content

Commit

Permalink
update packages and fix lints
Browse files Browse the repository at this point in the history
Signed-off-by: tabokie <xy.tao@outlook.com>
  • Loading branch information
tabokie committed Jun 13, 2022
1 parent 1bb8267 commit 7d73256
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 43 deletions.
37 changes: 20 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion components/coprocessor_plugin_api/src/lib.rs
@@ -1,5 +1,4 @@
// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0.
#![feature(const_fn_fn_ptr_basics)]

//! This crate contains some necessary types and traits for implementing a custom coprocessor plugin
//! for TiKV.
Expand Down
1 change: 0 additions & 1 deletion components/encryption/src/encrypted_file/mod.rs
Expand Up @@ -127,7 +127,6 @@ mod tests {

let content = b"test content";
file.write(content, &PlaintextBackend::default()).unwrap();
drop(file);

let file = EncryptedFile::new(tmp.path(), "encrypted");
assert_eq!(file.read(&PlaintextBackend::default()).unwrap(), content);
Expand Down
1 change: 0 additions & 1 deletion components/raftstore/src/lib.rs
Expand Up @@ -6,7 +6,6 @@
#![feature(min_specialization)]
#![feature(box_patterns)]
#![feature(hash_drain_filter)]
#![feature(vec_retain_mut)]
#![recursion_limit = "256"]

#[cfg(test)]
Expand Down
2 changes: 0 additions & 2 deletions components/tidb_query_executors/src/lib.rs
Expand Up @@ -10,8 +10,6 @@
#![allow(incomplete_features)]
#![feature(proc_macro_hygiene)]
#![feature(specialization)]
#![feature(const_fn_fn_ptr_basics)]
#![feature(const_fn_trait_bound)]
#![feature(const_mut_refs)]

#[macro_use(box_try, warn)]
Expand Down
2 changes: 0 additions & 2 deletions components/tidb_query_expr/src/lib.rs
Expand Up @@ -12,8 +12,6 @@
#![feature(proc_macro_hygiene)]
#![feature(specialization)]
#![feature(test)]
#![feature(const_fn_fn_ptr_basics)]
#![feature(const_fn_trait_bound)]
#![feature(const_mut_refs)]

#[macro_use(box_err, box_try, try_opt)]
Expand Down
9 changes: 4 additions & 5 deletions components/tikv_alloc/src/lib.rs
Expand Up @@ -134,8 +134,8 @@ mod runner {
extern crate test;
use test::*;

/// Check for test cases with ignore message "#ifdef <VAR_NAME>". The test
/// case will be un-ignored if the specific environment variable is set.
/// Check for ignored test cases with ignore message "#ifdef <VAR_NAME>". The test
/// case will be enabled if the specific environment variable is set.
pub fn run_env_conditional_tests(cases: &[&TestDescAndFn]) {
let cases: Vec<_> = cases
.iter()
Expand All @@ -148,9 +148,8 @@ mod runner {
};
if let Some(msg) = desc.ignore_message {
let keyword = "#ifdef";
if let Some(idx) = msg.find(keyword) {
let v = &msg[idx + keyword.len()..].trim();
if v.is_empty() || std::env::var(v).is_ok() {
if let Some(var_name) = msg.strip_prefix(keyword) {
if var_name.is_empty() || std::env::var(var_name).is_ok() {
desc.ignore = false;
desc.ignore_message = None;
}
Expand Down
2 changes: 1 addition & 1 deletion src/import/sst_service.rs
Expand Up @@ -295,7 +295,7 @@ macro_rules! impl_write {
Ok(resp)
}
.await;
crate::send_rpc_response!(res, sink, label, timer);
$crate::send_rpc_response!(res, sink, label, timer);
};

self.threads.spawn_ok(buf_driver);
Expand Down
2 changes: 1 addition & 1 deletion src/server/service/mod.rs
Expand Up @@ -18,7 +18,7 @@ pub use self::{
macro_rules! log_net_error {
($err:expr, $($args:tt)*) => {{
let e = $err;
if let crate::server::Error::Grpc(e) = e {
if let $crate::server::Error::Grpc(e) = e {
info!($($args)*, "err" => %e);
} else {
debug!($($args)*, "err" => %e);
Expand Down
5 changes: 1 addition & 4 deletions src/storage/mod.rs
Expand Up @@ -2691,10 +2691,7 @@ pub struct TxnTestSnapshot<S: Snapshot> {

impl<S: Snapshot> Snapshot for TxnTestSnapshot<S> {
type Iter = S::Iter;
type Ext<'a>
where
S: 'a,
= TxnTestSnapshotExt<'a>;
type Ext<'a> = TxnTestSnapshotExt<'a> where S: 'a;

fn get(&self, key: &Key) -> tikv_kv::Result<Option<Value>> {
self.snapshot.get(key)
Expand Down
5 changes: 1 addition & 4 deletions src/storage/raw/encoded.rs
Expand Up @@ -61,10 +61,7 @@ impl<S: Snapshot, F: KvFormat> RawEncodeSnapshot<S, F> {

impl<S: Snapshot, F: KvFormat> Snapshot for RawEncodeSnapshot<S, F> {
type Iter = RawEncodeIterator<S::Iter, F>;
type Ext<'a>
where
S: 'a,
= S::Ext<'a>;
type Ext<'a> = S::Ext<'a> where S: 'a;

fn get(&self, key: &Key) -> Result<Option<Value>> {
self.map_value(self.snap.get(key))
Expand Down
5 changes: 1 addition & 4 deletions src/storage/raw/raw_mvcc.rs
Expand Up @@ -43,10 +43,7 @@ impl<S: Snapshot> RawMvccSnapshot<S> {

impl<S: Snapshot> Snapshot for RawMvccSnapshot<S> {
type Iter = RawMvccIterator<S::Iter>;
type Ext<'a>
where
S: 'a,
= S::Ext<'a>;
type Ext<'a> = S::Ext<'a> where S: 'a;

fn get(&self, key: &Key) -> Result<Option<Value>> {
self.seek_first_key_value_cf(None, None, key)
Expand Down

0 comments on commit 7d73256

Please sign in to comment.