this post was submitted on 21 Dec 2023
38 points (100.0% liked)

Rust Programming

8114 readers
2 users here now

founded 5 years ago
MODERATORS
top 2 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 7 points 10 months ago

Aaaw yiiiss, been waiting for this, -> impl xxx simplifies function signatures soo much, so not being allowed to do that in traits was a real pain

[โ€“] [email protected] 3 points 10 months ago* (last edited 10 months ago)
trait HttpService {
    async fn fetch(&self, url: Url) -> HtmlBody;
//  ^^^^^^^^ desugars to:
//  fn fetch(&self, url: Url) -> impl Future;
}

Man I've been waiting for this to be stabilized for a long time. So excited about it.