Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(kademlia)!: use GATs on RecordStore trait #3239

Merged
merged 8 commits into from
Dec 22, 2022
Merged

Conversation

thomaseizinger
Copy link
Contributor

@thomaseizinger thomaseizinger commented Dec 14, 2022

Description

Previously, we applied a lifetime onto the entire RecordStore to workaround Rust not having GATs. With Rust 1.65.0 we now have GATs so we can remove this workaround.

Related #3240. Without this change, we would have to specify HRTB in various places.

Notes

Depends-On: libp2p/test-plans#90

Links to any relevant issues

Open Questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@thomaseizinger thomaseizinger changed the title feat(kademlia): use GATs on RecordStore trait feat(kademlia)!: use GATs on RecordStore trait Dec 14, 2022
@thomaseizinger
Copy link
Contributor Author

Friendly ping @mxinden :)

@mergify
Copy link
Contributor

mergify bot commented Dec 19, 2022

This pull request has merge conflicts. Could you please resolve them @thomaseizinger? 🙏

Copy link
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very nice to see :D

Comment on lines +67 to +73
pub trait RecordStore {
type RecordsIter<'a>: Iterator<Item = Cow<'a, Record>>
where
Self: 'a;
type ProvidedIter<'a>: Iterator<Item = Cow<'a, ProviderRecord>>
where
Self: 'a;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤯 🎉

@mergify mergify bot merged commit 1765ae0 into master Dec 22, 2022
@thomaseizinger thomaseizinger deleted the feat-kademlia/use-gats branch February 24, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants