Given an `impl FromIterator`, find item type
The Rust Programming Language Forum
Given an `impl FromIterator`, find item type
I'm trying to wrap an external generic API, which has a FromRepresentation trait implemented for most primitive types[1]. I'd like to add a way for this wrapper to collect items from this API into a collection. My first idea was "well, every collection is FromIterator<Item>, so can't I simply use that?" But apparently, I can't, because Rust (rightfully) cannot infer the Item I want: there might be multiple impl FromRepresentation for IteratorItem which would all correspond to impl FromIterator<I...
0 comments
No comments yet.