News for hackers. Stuff that matters.
Re:C++ Coroutines Do Not Spark Joy by nicoburns on Monday November 01, 2021 @12:14PM (#29068769)
In 2015 Rust you could write:

    fn twiddle<T: Foozle, IterT: IntoIterator<Item=T>>(foozles: IterT)
which I believe would still be considered idiomatic today. (this assumes that Foozle is a trait. If Foozle is a struct then you can simplify this). You can also now use the impl syntax you posted but it's just sugar and it's less flexible than the older method.
Re:C++ Coroutines Do Not Spark Joy by wizzwizz4 on Monday November 01, 2021 @03:12PM (#29071517)
That's how I used to write it in 2018, before I discovered the `impl` keyword. It's the obvious way of doing it. (Though I'd've used `Iterator` rather than `IntoIterator` because I came from Python. (Yes, I know `IntoIterator` is the version best matching Python's behaviour.))
Re:C++ Coroutines Do Not Spark Joy by tux3 on Monday November 01, 2021 @03:24PM (#29071689)
Note that impl is not exactly equivalent. If the type passed in is ambiguous, with an explicit template the caller can disambiguate, but with impl there's no template argument.

So sometimes you still want to use the "old" syntax in your public APIs, even when you could be using an impl trait