-
Notifications
You must be signed in to change notification settings - Fork 38
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: add a few usability functions to the interface #169
Conversation
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!
#[test] | ||
fn nibbles_as_byte_slice_works() -> Result<(), StrToNibblesError> { | ||
let cases = [ | ||
(0x0, vec![]), |
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.
Yeah I think this is good. Just reviewed what to_nibbles
does for unsigned integers, and the 0x0
case also goes to an empty Nibbles
and not the zero key.
Just an aside, but do you think this is good default behavior? Is this what you would expect, or should 0x0
map to the key 0x0
instead of empty
?
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.
specifically in the context of nibbles empty
makes more sense to me instead of 0x0
, but it is debatable
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! :)
Can we update the changelog and we'll merge |
* feat: add a few usability functions to the interface * fix: fix clippy issue * feat: add usize to nibbles * docs: update changelog.md --------- Co-authored-by: Vladimir Trifonov <[email protected]> Co-authored-by: Ben <[email protected]>
feat: add a few usability functions to the interface
Issue: #67