-
Notifications
You must be signed in to change notification settings - Fork 56
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
Implement Into<usize> for NodeId #58
Conversation
I just realized that |
Yes I think we should return the same, so the index1 based result. :) |
Should I then implement this for both |
I think it does not hurt, yeah. |
Also implement Into<NonZeroUsize> for NodeId
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
Sorry, I was too hasty, wasn't focusing well enough apparently. I just noticed on my own project, that with these two impls, I have a hard time using into. Now I get this error
I tried specifying types in different places, or explicitly calling |
Nevermind. On further inspection, I noticed that the problem is unrelated. Glad to contribute. Thanks for the rapid communication! |
Sounds good, I’m glad that it helps on your side. 👍 |
Implements
Into<usize> for NodeId
. This implementation returnsindex0()
since 0-based indexing is more conventional.A more explicit alternative would be making
index0
public. This would have the benefit of not being "less astonishing", since one might not expectInto
returning a different value.For background info, see the related issue