• Ignotum
    link
    fedilink
    75 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

  • @pm_me_your_quackers@lemmy.world
    link
    fedilink
    3
    edit-2
    5 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.