Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update default rust toolchain. #333

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ alias:

- &job-default
docker:
- image: cita/cita-build:ubuntu-18.04-20190107
- image: cita/cita-build:ubuntu-18.04-20190304
working_directory: ~/cita-build
resource_class: xlarge

Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ stages:
- Release
- IntegrateTest
before_install:
- docker pull cita/cita-build:ubuntu-18.04-20190107
- docker pull cita/cita-build:ubuntu-18.04-20190304
jobs:
include:

Expand Down
2 changes: 1 addition & 1 deletion cita-auth/src/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl Dispatcher {

pub fn get_txs(&self, ids: &[H256]) -> Vec<SignedTransaction> {
let pool = self.txs_pool.borrow();
ids.into_iter()
ids.iter()
.map(|id| pool.get(id).cloned())
.filter(|tx| tx.is_some())
.map(|tx| tx.unwrap())
Expand Down
6 changes: 3 additions & 3 deletions cita-auth/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,15 +548,15 @@ impl MsgHandler {
fn deal_black_list(&mut self, black_list: &BlackList) {
black_list
.get_clear_list()
.into_iter()
.iter()
.for_each(|clear_list: &Vec<u8>| {
self.black_list_cache
.remove(&Address::from_slice(clear_list.as_slice()));
});

black_list
.get_black_list()
.into_iter()
.iter()
.for_each(|blacklist: &Vec<u8>| {
self.black_list_cache
.entry(Address::from_slice(blacklist.as_slice()))
Expand Down Expand Up @@ -857,7 +857,7 @@ impl MsgHandler {
fn deal_get_block_txn(&mut self, get_block_txn: &mut GetBlockTxn, origin: Origin) {
let short_ids: Vec<H256> = get_block_txn
.get_short_ids()
.into_iter()
.iter()
.map(|id| H256::from(U256::from(id.as_slice())))
.collect();
let txs: Vec<UnverifiedTransaction> = self
Expand Down
2 changes: 1 addition & 1 deletion cita-bft
17 changes: 8 additions & 9 deletions cita-chain/core/src/libchain/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,13 @@ impl TxProof {
let from_chain_id = U256::from(iter.next().unwrap());
let to_chain_id = U256::from(iter.next().unwrap());
let dest_contract = Address::from(H256::from(iter.next().unwrap()));
let dest_hasher = iter.next().unwrap()[..4]
.into_iter()
.take(4)
.enumerate()
.fold([0u8; 4], |mut acc, (idx, val)| {
let dest_hasher = iter.next().unwrap()[..4].iter().take(4).enumerate().fold(
[0u8; 4],
|mut acc, (idx, val)| {
acc[idx] = *val;
acc
});
},
);
let cross_chain_nonce = U256::from(iter.next().unwrap()).low_u64();
Some(RelayInfo {
from_chain_id,
Expand Down Expand Up @@ -459,12 +458,12 @@ impl Chain {
let conf = ret.get_config();
let nodes = conf.get_nodes();
let nodes: Vec<Address> = nodes
.into_iter()
.iter()
.map(|vecaddr| Address::from_slice(&vecaddr[..]))
.collect();
let validators = conf.get_validators();
let validators: Vec<Address> = validators
.into_iter()
.iter()
.map(|vecaddr| Address::from_slice(&vecaddr[..]))
.collect();
let block_interval = conf.get_block_interval();
Expand Down Expand Up @@ -522,7 +521,7 @@ impl Chain {
if !info.get_receipts().is_empty() {
let receipts: Vec<Receipt> = info
.get_receipts()
.into_iter()
.iter()
.map(|receipt_with_option| Receipt::from(receipt_with_option.get_receipt().clone()))
.collect();

Expand Down
2 changes: 1 addition & 1 deletion cita-chain/types/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl Filter {
.into_iter()
.flat_map(|bloom| {
topics
.into_iter()
.iter()
.map(|topic| {
let mut b = bloom;
b.accrue_raw(topic);
Expand Down
4 changes: 2 additions & 2 deletions cita-chain/types/src/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,12 @@ impl From<ProtoReceipt> for Receipt {

let logs = receipt
.get_logs()
.into_iter()
.iter()
.map(|log_entry| {
let address: Address = Address::from_slice(log_entry.get_address());
let topics: Vec<H256> = log_entry
.get_topics()
.into_iter()
.iter()
.map(|topic| H256::from_slice(topic))
.collect();
let data: Bytes = Bytes::from(log_entry.get_data());
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 @@ -42,7 +42,7 @@ use util::Bytes;
pub fn extract_logs_from_response(sender: Address, response: &InvokeResponse) -> Vec<LogEntry> {
response
.get_logs()
.into_iter()
.iter()
.map(|log| {
let mut topics = Vec::new();
let tdata = log.get_topic();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl CrossChainVerify {
if result.is_none() {
return Err(Error::Internal("decode 2nd param failed".to_string()));
}
let hasher = result.unwrap()[..4].into_iter().take(4).enumerate().fold(
let hasher = result.unwrap()[..4].iter().take(4).enumerate().fold(
[0u8; 4],
|mut acc, (idx, val)| {
acc[idx] = *val;
Expand Down
2 changes: 1 addition & 1 deletion cita-executor/core/src/libexecutor/lru_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ where
self.cache_by_key.remove(k);

let v: Vec<V> = v
.into_iter()
.iter()
.filter(|value| match self.cache_by_value.get(value) {
Some(ref key) if key == &k => true,
None | Some(_) => false,
Expand Down
2 changes: 1 addition & 1 deletion cita-executor/src/backlogs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ impl Backlogs {
let executed_result = &self.completed[&prev_height];
let validators = executed_result.get_config().get_validators();
let proof_checkers: Vec<Address> = validators
.into_iter()
.iter()
.map(|vec| Address::from_slice(&vec[..]))
.collect();

Expand Down
2 changes: 1 addition & 1 deletion cita-forever
2 changes: 1 addition & 1 deletion daemon.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

DOCKER_IMAGE="cita/cita-build:ubuntu-18.04-20190107"
DOCKER_IMAGE="cita/cita-build:ubuntu-18.04-20190304"
if [[ `uname` == 'Darwin' ]]
then
cp /etc/localtime $PWD/localtime
Expand Down
2 changes: 1 addition & 1 deletion env.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

DOCKER_IMAGE="cita/cita-build:ubuntu-18.04-20190107"
DOCKER_IMAGE="cita/cita-build:ubuntu-18.04-20190304"
if [[ `uname` == 'Darwin' ]]
then
cp /etc/localtime $PWD/localtime
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

DOCKER_IMAGE="cita/cita-build:ubuntu-18.04-20190107"
DOCKER_IMAGE="cita/cita-build:ubuntu-18.04-20190304"

if [[ `uname` == 'Darwin' ]]
then
Expand Down
2 changes: 1 addition & 1 deletion tools/create_key_addr/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use std::fs::{File, OpenOptions};
use std::io::Write;

fn to_hex_string(data: &[u8]) -> String {
let strs: Vec<String> = data.into_iter().map(|a| format!("{:02x}", a)).collect();
let strs: Vec<String> = data.iter().map(|a| format!("{:02x}", a)).collect();
strs.join("")
}

Expand Down