Add impl AsRef<[u8]> for Uuid #472
Labels
No labels
breaking
bug
dependencies
good first issue
help wanted
unstable
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-uuid-rs/uuid#472
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
Add some along this lines:
Is it blocking?
No
Describe alternatives you've considered
I tried:
but got:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=a5cd3e47bec30ab4c71ad4270dfb3f04
Additional context
It feels this should be implemented for to cover the Interoperability princible. #191
This error is indicating that UUID does implement
AsRef<[u8]>, thus yourimpl AsBytes for uuid::Uuid { /*...*/ }is redundant because it's already covered by the impl forT: AsRef<[u8]>.https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=41676e06eebccf5753fb17190310db5f
You are mistaken the line
println!("{:?}", uuid::Uuid::new_v4().as_bytes());doesn't call theas_bytesfrom theAsBytestrait, instead it refers to this method as_bytes defined by some Uuid impl;Changing it's name to
as_bytes1show ithttps://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=db29daa3d9903148511de34966430627
Ah, whoops.
Adding an
AsRef<[u8]> for Uuidseems reasonable to me. Would somebody like to PR it?