Post

Using impl Trait in the return position is one of Rust's most useful features for library authors. It allows you to change the concrete type without breaking semver. e.g. `fn printable() -> impl std::fmt::Display` would enable you to return anything that you want that implements Display.

A picture to feed the algorithm. By returning impl Trait, you're free to change what's happening underneath. This is especially useful when you want to compose iterators.

0 reposts9 likes

No replies yet.