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

Remove NodeId::new() and make NodeId::from_non_zero_usize() crate-local #48

Conversation

lo48576
Copy link
Contributor

@lo48576 lo48576 commented Aug 4, 2019

This is breaking change.

NodeId should not be crafted by the users.
Users should get correct NodeId from accessors and Arena::new_node().
It is easy to store (since it implements Copy trait and has no lifetime restriction), and node access does not require direct integer index.

Additionally, users cannot get internal index from NodeId in usual way.
(They can guess the index, but it depends on hidden internal implementation, and it might be changed silently because it is hidden.)

NodeId::new() and NodeId::from_non_zero_usize() is useless for users.

…-local

`NodeId` should not be crafted by the users.
Users should get correct `NodeId` from accessors and `Arena::new_node()`.
It is easy to store (since it implements `Copy` trait and has no
lifetime restriction), and node access does not require direct integer
index.

Additionally, users cannot get internal index from `NodeId` in usual way.
(They can guess the index, but it depends on hidden internal
implementation, and it might be changed silently because it is hidden.)

`NodeId::new()` and `NodeId::from_non_zero_usize()` is useless for users.
@saschagrunert saschagrunert merged commit 00e776f into saschagrunert:master Aug 4, 2019
@lo48576 lo48576 deleted the feature/remove-lowlevel-nodeid-constructor branch August 4, 2019 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants