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

chore(kad): remove unrequired generics #5476

Merged
merged 7 commits into from
Jun 27, 2024
Merged

Conversation

jxs
Copy link
Member

@jxs jxs commented Jun 25, 2024

Description

Remove the unrequired generics in kad and refactor the code for less duplication.
Please review by commit order as it will be easier to understand each commit's rational and logic

we don't ever abstract over it, it's always parametrized to QueryInner
jxs added 4 commits June 25, 2024 12:06
libp2p-core should aim to be thinier, see libp2p#3072 (reply in thread)
and rather create a new struct QueryPeers which should aim to have all the shared properties of the
3 different query types: Fixed, Closed, and ClosedDisjoint
Copy link
Contributor

@guillaumemichel guillaumemichel left a comment

Choose a reason for hiding this comment

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

Very elegant! It is a great code simplification to get rid of the QueryInner 👍🏻

protocols/kad/src/behaviour.rs Show resolved Hide resolved
protocols/kad/src/query.rs Show resolved Hide resolved
@guillaumemichel guillaumemichel mentioned this pull request Jun 25, 2024
4 tasks
@jxs
Copy link
Member Author

jxs commented Jun 25, 2024

cc @Wiezzel for the PeerInfo location

@jxs jxs added the send-it label Jun 26, 2024
@mergify mergify bot merged commit 63313f4 into libp2p:master Jun 27, 2024
72 checks passed
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.

None yet

3 participants