I have so far transformed two crates that have iterable-like properties in traits from using HRTBs to GATs. And I was seriously surprised how easy it was. The compiler gave me all the hints I needed to make everything compile. And there were only minor changes required, like removing lifetime arguments from traits or changing the type definition in trait implementations.

I wonder, has anyone encountered any difficulties when transforming their code from HRTBs to GATs?

  • chrysn@chaos.social
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    @Sibbo It’s been a wild ride ridden with back-and-forths about where where Self: 'a goes and whether it’s needed, but that’s largely past (now that it’s stable), and my use case (the coap-message crate) works fine with it.