Skip to content

Add Hash trait to TreeNode - #75

Closed
quexeky wants to merge 3 commits into
n0-computer:mainfrom
quexeky:main
Closed

Add Hash trait to TreeNode#75
quexeky wants to merge 3 commits into
n0-computer:mainfrom
quexeky:main

Conversation

@quexeky

@quexeky quexeky commented Apr 27, 2026

Copy link
Copy Markdown

I'm trying to use TreeNodes in a HashMap (so that I can easily traverse the tree) and noticed that the Hash trait isn't implemented for them.

@n0bot n0bot Bot added this to iroh Apr 27, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh Apr 27, 2026
@dignifiedquire dignifiedquire moved this from 🚑 Needs Triage to 🏗 In progress in iroh May 19, 2026
Comment thread src/lib.rs
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct TreeNode(u64);
pub struct TreeNode(pub u64);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we need the pub here?

@rklaehn

rklaehn commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

I added hash in a separate commit. Don't want the pub.

@rklaehn rklaehn closed this Aug 10, 2026
@github-project-automation github-project-automation Bot moved this from 🏗 In progress to ✅ Done in iroh Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants