Bumping clippy & fixing warnings (#1823)

* Bumping clippy

* Fixing clippy warnings

* Cargo.lock (latest nightly?)
This commit is contained in:
Tomasz Drwięga
2016-08-03 19:01:48 +02:00
committed by Gav Wood
parent 531bc79edc
commit deceb5fd56
22 changed files with 194 additions and 48 deletions

View File

@@ -359,7 +359,7 @@ impl BlockChain {
let batch = DBTransaction::new(&db);
batch.put(DB_COL_HEADERS, &hash, block.header_rlp().as_raw()).unwrap();
batch.put(DB_COL_BODIES, &hash, &Self::block_to_body(&genesis)).unwrap();
batch.put(DB_COL_BODIES, &hash, &Self::block_to_body(genesis)).unwrap();
batch.write(DB_COL_EXTRA, &hash, &details);
batch.write(DB_COL_EXTRA, &header.number(), &hash);
@@ -1056,7 +1056,7 @@ mod tests {
let bc = BlockChain::new(Config::default(), &genesis, db.clone());
let batch = db.transaction();
for b in [&b1a, &b1b, &b2a, &b2b, &b3a, &b3b, &b4a, &b4b, &b5a, &b5b].iter() {
for b in &[&b1a, &b1b, &b2a, &b2b, &b3a, &b3b, &b4a, &b4b, &b5a, &b5b] {
bc.insert_block(&batch, b, vec![]);
bc.commit();
}

View File

@@ -712,7 +712,7 @@ impl BlockChainClient for Client {
x.state_diff = Some(state.diff_from(orig));
}
}
ret.map_err(|ee| ReplayError::Execution(ee))
ret.map_err(ReplayError::Execution)
}
fn keep_alive(&self) {

View File

@@ -98,7 +98,7 @@ impl From<ethjson::spec::Account> for PodAccount {
PodAccount {
balance: a.balance.map_or_else(U256::zero, Into::into),
nonce: a.nonce.map_or_else(U256::zero, Into::into),
code: a.code.map(Into::into).or(Some(Vec::new())),
code: a.code.map(Into::into).or_else(|| Some(Vec::new())),
storage: BTreeMap::new()
}
}

View File

@@ -391,7 +391,7 @@ impl StateRebuilder {
}
}
let batch = DBTransaction::new(&self.db.backing());
let batch = DBTransaction::new(self.db.backing());
try!(self.db.commit(&batch, 0, &H256::zero(), None));
try!(self.db.backing().write(batch).map_err(|e| Error::Util(e.into())));
Ok(())