I need to return a list of Cow<str> from a function, but my strs have different lifetimes. Before they had different lifetime, I could just map to Cow::from, but now I need to specify for each element:
Could you clarify what you're trying to accomplish? You already have an array of Cows and from it you create an iterator of Cows and collect it into a collection (say, Vec<Cow<str>>). So why do you want to use map(Cow::from)? What do you want to do that's different from, say: