This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Date = chrono::Date<chrono::Local>; | |
pub struct DateIterator { | |
start: Date, | |
end: Date | |
} | |
impl Iterator for DateIterator { | |
// ... not important | |
} | |
impl DateIterator { | |
pub fn by_months<'a>(self) -> Groups<'a, u32, DateIterator, fn(&Date) -> u32> { | |
fn month(d: &Date) -> u32 { d.month() } | |
self.group_by_lazy(month).into_iter() // <-- ERROR | |
} | |
} | |
// expected `itertools::groupbylazy::Groups<'a, u32, iter::DateIterator, fn(&chrono::date::Date<chrono::offset::local::Local>) -> u32>`, | |
// found `itertools::groupbylazy::Groups<'_, u32, iter::DateIterator, fn(&chrono::date::Date<chrono::offset::local::Local>) -> u32 {iter::DateIterator::by_months::month}>` | |
// (expected fn pointer, | |
// found fn item) [E0308] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment