Clippy bump (#2877)

* Bumping clippy

* Fixing warnings

* Fix the "fix"
This commit is contained in:
Tomasz Drwięga
2016-10-27 08:28:12 +02:00
committed by Gav Wood
parent 9bfb8094cc
commit 88997801d0
39 changed files with 117 additions and 112 deletions

View File

@@ -84,7 +84,7 @@ impl Journal {
pub fn apply(self, db: &mut HashDB) -> Score {
trace!("applying {:?} changes", self.0.len());
let mut ret = Score{inserts: 0, removes: 0};
for d in self.0.into_iter() {
for d in self.0 {
match d {
Operation::Delete(h) => {
trace!("TrieDBMut::apply --- {:?}", &h);

View File

@@ -87,7 +87,7 @@ impl<'db> TrieDB<'db> {
/// Convert a vector of hashes to a hashmap of hash to occurrences.
pub fn to_map(hashes: Vec<H256>) -> HashMap<H256, u32> {
let mut r: HashMap<H256, u32> = HashMap::new();
for h in hashes.into_iter() {
for h in hashes {
*r.entry(h).or_insert(0) += 1;
}
r
@@ -97,7 +97,7 @@ impl<'db> TrieDB<'db> {
/// trie.
pub fn db_items_remaining(&self) -> super::Result<HashMap<H256, i32>> {
let mut ret = self.db.keys();
for (k, v) in Self::to_map(try!(self.keys())).into_iter() {
for (k, v) in Self::to_map(try!(self.keys())) {
let keycount = *ret.get(&k).unwrap_or(&0);
match keycount <= v as i32 {
true => ret.remove(&k),