Skip to content

Commit

Permalink
upgrade docker image and clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
driftluo committed Oct 10, 2018
1 parent fece902 commit c302f77
Show file tree
Hide file tree
Showing 37 changed files with 94 additions and 79 deletions.
50 changes: 25 additions & 25 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions cita-auth/src/batch_forward.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl BatchForward {
batch_size,
timeout,
check_duration: 5,
last_timestamp: unix_now().as_millis(),
last_timestamp: AsMillis::as_millis(&unix_now()),
request_buffer: Vec::new(),
rx_request,
tx_pub,
Expand All @@ -63,7 +63,7 @@ impl BatchForward {
}
} else {
thread::sleep(Duration::new(0, self.check_duration * 1_000_000));
let now = unix_now().as_millis();
let now = AsMillis::as_millis(&unix_now());
if (now - self.last_timestamp) > self.timeout && !self.request_buffer.is_empty() {
self.batch_forward();
}
Expand Down Expand Up @@ -92,7 +92,7 @@ impl BatchForward {
))
.unwrap();

self.last_timestamp = unix_now().as_millis();
self.last_timestamp = AsMillis::as_millis(&unix_now());
self.request_buffer.clear();
}
}
8 changes: 4 additions & 4 deletions cita-auth/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ impl HistoryHeights {

// at least wait 3s from latest update
pub fn is_too_frequent(&self) -> bool {
unix_now().as_millis() < self.last_timestamp + 3000
AsMillis::as_millis(&unix_now()) < self.last_timestamp + 3000
}

pub fn update_time_stamp(&mut self) {
// update time_stamp
self.last_timestamp = unix_now().as_millis();
self.last_timestamp = AsMillis::as_millis(&unix_now());
}
}

Expand Down Expand Up @@ -311,7 +311,7 @@ impl MsgHandler {
}
}

#[allow(unknown_lints, option_option)] // TODO clippy
#[allow(unknown_lints, clippy::option_option)] // TODO clippy
fn get_ret_from_cache(&self, tx_hash: &H256) -> Option<Option<Vec<u8>>> {
self.cache.peek(tx_hash).cloned()
}
Expand Down Expand Up @@ -825,7 +825,7 @@ impl MsgHandler {
self.process_block_verify(blk_req);
}

#[allow(unknown_lints, cyclomatic_complexity)] // TODO clippy
#[allow(unknown_lints, clippy::cyclomatic_complexity)] // TODO clippy
fn deal_request(&mut self, is_local: bool, newtx_req: Request) {
if newtx_req.has_batch_req() {
let batch_new_tx = newtx_req.get_batch_req().get_new_tx_requests();
Expand Down
1 change: 1 addition & 0 deletions cita-auth/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
#![feature(custom_attribute)]
#![feature(integer_atomics)]
#![feature(try_from)]
#![feature(tool_lints)]

extern crate cita_crypto as crypto;
extern crate cita_types;
Expand Down
2 changes: 1 addition & 1 deletion cita-bft
2 changes: 1 addition & 1 deletion cita-chain/core/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub trait Cache<K, V> {
fn get(&self, k: &K) -> Option<&V>;
}

#[allow(unknown_lints, implicit_hasher)] // TODO clippy
#[allow(unknown_lints, clippy::implicit_hasher)] // TODO clippy
impl<K, V> Cache<K, V> for HashMap<K, V>
where
K: Hash + Eq,
Expand Down
4 changes: 2 additions & 2 deletions cita-chain/core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl fmt::Display for TransactionError {
}
}

#[allow(unknown_lints, large_enum_variant)] // TODO clippy
#[allow(unknown_lints, clippy::large_enum_variant)] // TODO clippy
#[derive(Debug, PartialEq, Clone, Copy, Eq)]
/// Errors concerning block processing.
pub enum BlockError {
Expand Down Expand Up @@ -295,7 +295,7 @@ impl fmt::Display for ExecutionError {
}
}

#[allow(unknown_lints, large_enum_variant)] // TODO clippy
#[allow(unknown_lints, clippy::large_enum_variant)] // TODO clippy
#[derive(Debug)]
/// General error type which should be capable of representing all errors in ethcore.
pub enum Error {
Expand Down
2 changes: 2 additions & 0 deletions cita-chain/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#![feature(try_from)]
#![cfg_attr(test, feature(test))]
#![feature(tool_lints)]

extern crate byteorder;
#[macro_use]
extern crate lazy_static;
Expand Down
2 changes: 2 additions & 0 deletions cita-chain/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
//!

#![feature(try_from)]
#![feature(tool_lints)]

extern crate byteorder;
extern crate cita_types;
extern crate clap;
Expand Down
1 change: 0 additions & 1 deletion cita-executor/core/src/cache_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ where
max_cache_size,
bytes_per_cache_entry,
cache_usage: (0..COLLECTION_QUEUE_SIZE)
.into_iter()
.map(|_| Default::default())
.collect(),
}
Expand Down
2 changes: 1 addition & 1 deletion cita-executor/core/src/contracts/grpc/grpc_vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl<'a, B: 'a + StateBackend> CallEvmImpl<'a, B> {
env_info: &EnvInfo,
action_params: &ActionParams,
connect_info: &ConnectInfo,
options: &TransactOptions,
options: TransactOptions,
) -> Result<Receipt, Error> {
let mut invoke_request = InvokeRequest::new();
invoke_request.set_param(action_params.to_owned());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl<'a> PermissionManagement<'a> {
}

/// Check the account contains the resource
#[allow(unknown_lints, implicit_hasher)] // TODO clippy
#[allow(unknown_lints, clippy::implicit_hasher)] // TODO clippy
pub fn contains_resource(
account_permissions: &HashMap<Address, Vec<Resource>>,
account: &Address,
Expand Down
2 changes: 1 addition & 1 deletion cita-executor/core/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub trait Cache<K, V> {
fn get(&self, k: &K) -> Option<&V>;
}

#[allow(unknown_lints, implicit_hasher)] // TODO clippy
#[allow(unknown_lints, clippy::implicit_hasher)] // TODO clippy
impl<K, V> Cache<K, V> for HashMap<K, V>
where
K: Hash + Eq,
Expand Down
4 changes: 2 additions & 2 deletions cita-executor/core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl fmt::Display for TransactionError {
}
}

#[allow(unknown_lints, large_enum_variant)] // TODO clippy
#[allow(unknown_lints, clippy::large_enum_variant)] // TODO clippy
#[derive(Debug, PartialEq, Clone, Copy, Eq)]
/// Errors concerning block processing.
pub enum BlockError {
Expand Down Expand Up @@ -217,7 +217,7 @@ impl fmt::Display for ImportError {
}
}

#[allow(unknown_lints, large_enum_variant)] // TODO clippy
#[allow(unknown_lints, clippy::large_enum_variant)] // TODO clippy
#[derive(Debug)]
/// General error type which should be capable of representing all errors in ethcore.
pub enum Error {
Expand Down
Loading

0 comments on commit c302f77

Please sign in to comment.