Use full qualified syntax for itertools::Itertools::flatten (#8606)

This commit is contained in:
Wei Tang 2018-05-14 15:22:59 +08:00 committed by Niklas Adolfsson
parent 979af3d314
commit 981554cf74

View File

@ -16,7 +16,7 @@
use std::collections::HashMap; use std::collections::HashMap;
use parking_lot::RwLock; use parking_lot::RwLock;
use itertools::Itertools; use itertools;
use ethkey::Address; use ethkey::Address;
use {SafeAccount, Error}; use {SafeAccount, Error};
@ -30,7 +30,7 @@ pub struct MemoryDirectory {
impl KeyDirectory for MemoryDirectory { impl KeyDirectory for MemoryDirectory {
fn load(&self) -> Result<Vec<SafeAccount>, Error> { fn load(&self) -> Result<Vec<SafeAccount>, Error> {
Ok(self.accounts.read().values().cloned().flatten().collect()) Ok(itertools::Itertools::flatten(self.accounts.read().values().cloned()).collect())
} }
fn update(&self, account: SafeAccount) -> Result<SafeAccount, Error> { fn update(&self, account: SafeAccount) -> Result<SafeAccount, Error> {