• Ignotum@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    11 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
    arrow-up
    5
    arrow-down
    1
    ·
    edit-2
    11 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.