this post was submitted on 10 Jun 2023
12 points (100.0% liked)

Rust Lang

117 readers
1 users here now

Rules [Developing]

Observe our code of conduct

Constructive criticism only

No endless relitigation

No low-effort content

No memes or image macros

No NSFW Content

founded 1 year ago
MODERATORS
 

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?

you are viewing a single comment's thread
view the rest of the comments
[–] admin@lemmyrs.org 3 points 1 year ago

I’m yet to get my hands dirty with GATs, just haven’t had the opportunity yet. I typically write application code instead of building libraries so that’s partially the reason I suppose. One of these days though I’m sure I’ll get to it.

It’s promising that you were able to switch with relative ease, excellent work!