Skip to content

Commit

Permalink
Problem: calling .flatten() from itertools fails on nightly
Browse files Browse the repository at this point in the history
```
   --> sit-web/src/webapp.rs:202:32
       |
   202 |             let record = match sit_core::repository::IssueRecordIter::flatten(issue.record_iter().unwrap()).find(|r| r.encoded_hash() == record) {
       |                                                                       ^^^^^^^ multiple `flatten` found
       |
       = note: candidate #1 is defined in an impl of the trait `std::iter::Iterator` for the type `sit_core::repository::IssueRecordIter<'_>`
       = note: candidate #2 is defined in an impl of the trait `itertools::Itertools` for the type `_`
       = note: candidate #3 is defined in the trait `rayon::iter::ParallelIterator`
```

This is, perhaps, related to the addition of the [`iterator_flatten`
nightly feature](rust-lang/rust#48213).

Solution: use itertools' version explicitly
  • Loading branch information
yrashk committed Feb 26, 2018
1 parent ffec039 commit 210d4b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sit-web/src/webapp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ pub fn start<A: ToSocketAddrs>(addr: A, config: sit_core::cfg::Configuration, re
Some(issue) => issue,
None => return Response::empty_404(),
};
let record = match issue.record_iter().unwrap().flatten().find(|r| r.encoded_hash() == record) {
let record = match ::itertools::Itertools::flatten(issue.record_iter().unwrap()).find(|r| r.encoded_hash() == record) {
Some(record) => record,
None => return Response::empty_404(),
};
Expand Down

0 comments on commit 210d4b3

Please sign in to comment.