|
|
|
|
|
by Ar-Curunir
2265 days ago
|
|
This is an anecdote, but I'm someone who keeps up rather zealously with language updates, and even though I write a lot of generic-heavy code, I don't think my code contains a single instance of `impl Trait` in either argument or return position, across over 60,000 lines of rust code |
|
Do you ever write code that returns, e.g., an `Iterator` ? e.g.
`impl Trait` in return position is the only way to write that kind of code, because you can't name closures. You can workaround this by re-implementing a custom `Map` iterator... Or if you are dealing with `Future`s, by writing a new custom `Future` type, but with `impl Trait`, you don't need to.I use it a lot. What before required a lot of boilerplate, now is a one liner.