This repository has been archived by the owner on Jun 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 204
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Converting an u16 to bytes can easily be done with just the standard library. This does not need the byteorder crate. Signed-off-by: Uli Schlachter <[email protected]>
Reading u8, u16, u32, and u64 can easily be done with what the standard library provides and does not need the byteorder crate. Signed-off-by: Uli Schlachter <[email protected]>
Similar to the previous commit: What byteorder provides here can easily be done with the standard library. This moves the helper functions that were added in the previous commit to "spec" (since "read" already imports "spec", but not the other way) and converts the code to use these helpers instead of byteorder. Signed-off-by: Uli Schlachter <[email protected]>
One really does not need the byteorder crate to write some bytes of data. It can easily be done with methods from the std library. Signed-off-by: Uli Schlachter <[email protected]>
Signed-off-by: Uli Schlachter <[email protected]>
This commit converts the reading code in the "write" module to use the read_u16() helper function that was added in a previous commit. Signed-off-by: Uli Schlachter <[email protected]>
We do not need the "byteorder" crate for writing little endian numbers to a Write, but can do that just with methods from std. Signed-off-by: Uli Schlachter <[email protected]>
The previous commits replaces the use of this crate and it is now unused and can be removed. Signed-off-by: Uli Schlachter <[email protected]>
I do not know where these differences come from. I didn't touch this code. But CI is telling me to fix this. Signed-off-by: Uli Schlachter <[email protected]>
The warning is "variable does not need to be mutable". But actually, this whole variable is not needed and can just be inlined into its only use. Signed-off-by: Uli Schlachter <[email protected]>
The warnings include: - roundtrip() takes a &mut, but only uses this argument non-mutably - using std::mem::replace() to replace an Option with None (just use .take() instead) - "manual backwards iteration", i.e. using rev().next() instead of next_back() Signed-off-by: Uli Schlachter <[email protected]>
This repo is no longer maintained. Could you please rebase this change against https://github.com/zip-rs/zip2 and submit it there? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I came across the use of "byteorder" in this crate and thought "one does not really need byteorder for this". Feel free to disagree and to just close this PR.
Since there are many uses of "byteorder", I tried to do this in small parts and do a commit for each one. Hopefully this makes it easier to understand what is going on. Dunno.
Then I noticed that actions are failing in my fork. The last few commits make rustfmt and clippy happy. These changes are unrelated to this PR. Feel free to cherry pick what you want.
Note that CI will still fail, because:
I'll leave that one to you.