I have the following chain of iterator calls:
pub fn to_usr_fmt(&self) -> String {
self.into_iter()
.map(|token| token.to_user_fmt())
.intersperse("-")
.collect()
}
The intersperse
iterator from itertools
is generating a warning about a potential name collision with the std lib
sometime in the future.
To fully qualify the function call (thus eliminating the possibility of a name collision) I tried a "quick and dirty" aliasing doing something like
let new_name = itertools::Itertools::intersperse;
However, for reasons likely obvious to many (not me in the moment), I received a typing error when I tried to use it in the chain of function calls.
Does anyone have any ideas for how to address the warning without losing the readability of the code?