Skip to content

Commit

Permalink
Deal with new warning
Browse files Browse the repository at this point in the history
rustc now warns that I shouldn't use `itertools::Itertools::flatten`
because the standard library is adopting an equivalent method. Switch
to the free function `itertools::flatten` instead.
  • Loading branch information
8573 committed May 25, 2018
1 parent c001898 commit dfebfd4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/core/modl_sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use super::Trigger;
use super::TriggerAttr;
use super::TriggerHandler;
use super::trigger::TriggerPriority;
use itertools::Itertools;
use itertools;
use regex::Regex;
use std;
use std::borrow::Cow;
Expand Down Expand Up @@ -277,14 +277,12 @@ impl State {
where
Modls: IntoIterator<Item = Module>,
{
let errs = modules
.into_iter()
.filter_map(|module| match self.load_module(module, mode) {
let errs = itertools::flatten(modules.into_iter().filter_map(|module| {
match self.load_module(module, mode) {
Ok(()) => None,
Err(e) => Some(e),
})
.flatten()
.collect::<Vec<Error>>();
}
})).collect::<Vec<Error>>();

if errs.is_empty() {
Ok(())
Expand Down

0 comments on commit dfebfd4

Please sign in to comment.