fn main() {
// `<slice as IntoIterator>::Item` is `&&str` type
let v: Vec<&&str> = ["a", "b"][..].into_iter().collect();
need_one_iterator(v.iter().map(|&&s| s));
need_one_iterator(v.into_iter().map(|&s| s));
}
// but this function needs an iterator yielding `&str`
fn need_one_iterator<'i>(_: impl Iterator<Item = &'i str>) {}
Using .map
and reference pattern is the only way I can think of here.