Add little-endian functions #330
No reviewers
Labels
No labels
breaking
bug
dependencies
good first issue
help wanted
unstable
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-uuid-rs/uuid!330
Loading…
Reference in a new issue
No description provided.
Delete branch "master"
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?
I'm submitting a feature
Description
This PR adds little-endian constructors as well as a
to_bytes_leand ato_fields_lemethod. I've also renamed the previous bytes methods and appended the be suffix for consistency while adding the previous function names as wrapper methods around those to not break things. All of this is personal preference of course so far so please point out changes you want to have with this.Edit: I forgot to mention that the le methods use the
to_*naming conventions instead ofas_*since they aren't a free conversion and dont return a&BytesMotivation
Issue #277.
Tests
Tested via doc-tests
Related Issue(s)
#277
Because we still keep the internal big-endian representation(as said in https://github.com/uuid-rs/uuid/issues/277#issuecomment-403608673).
Ah that's fine. It was a bit odd when I read the code. 👍
@Veykril once you are done, run
cargo fmtusing the latest nightly.@Veykril is this ready for review or you have more stuff to add? (can remove the WIP from the title)
Should be ready now I believe
bors: r+
Build succeeded
I realized after the merge that this really messes with
serdesupport... We want to look alternates to this approachHow exactly does it mess with serde? The internal representation didn't change so it shouldn't have any impact with serialization, or am I missing something?
The user might be using something like
bincodeand expecting the LE read AND LE write... but serde ofc doesnt do that... its a BE write@Veykril we are currently discussing this on gitter if you want to join in: http://gitter.im/uuid-rs/Lobby
So what we were discussing is: