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

Rename EndianBuf to EndianSlice #295

Merged
merged 3 commits into from
Apr 29, 2018

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Apr 28, 2018

Makes it more clear that it isn't an owning pointer, and clears the way for adding an owned arc/rc/whatever version in #294

To make it easier to upgrade, we export a deprecated type alias.
@coveralls
Copy link

coveralls commented Apr 28, 2018

Coverage Status

Coverage decreased (-0.01%) to 92.395% when pulling 7011449 on fitzgen:rename-EndianBuf-to-EndianSlice into c13119b on gimli-rs:master.

Copy link
Collaborator

@philipc philipc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's a better name, but not completely convinced its worth the churn for users of the library (they'll probably have their variables called buf still).

Needs a couple of changes for rustfmt.

@@ -0,0 +1,362 @@
//! Types for compile-time and run-time endianity.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs updating.

where
Endian: Endianity,
{
buf: &'input [u8],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth renaming this too?

@fitzgen
Copy link
Member Author

fitzgen commented Apr 29, 2018

I agree it's a better name, but not completely convinced its worth the churn for users of the library (they'll probably have their variables called buf still).

Did you see that there is a type alias type EndianBuf = EndianSlice; to ease upgrades? It is marked deprecated, with a note saying that the type has been renamed. Should hopefully mean that upgrading isn't actually very hard.

Addresses review feedback.
@fitzgen
Copy link
Member Author

fitzgen commented Apr 29, 2018

Which rustfmt have you been using? I just ran the latest nightly's rustfmt-preview component on rustup and it is introducing a ton of changes outside of the files I touched here.

@fitzgen fitzgen merged commit f177b94 into gimli-rs:master Apr 29, 2018
@philipc
Copy link
Collaborator

philipc commented Apr 29, 2018

The stable channel rustfmt-preview from rustc 1.25.

@fitzgen
Copy link
Member Author

fitzgen commented Apr 29, 2018

Huh. Even with cargo +stable fmt and

$ rustc +stable --version
rustc 1.25.0 (84203cac6 2018-03-25)

I'm still getting lots of unrelated formatting changes.

@philipc
Copy link
Collaborator

philipc commented Apr 30, 2018

Don't know what's going on then. I'll run it when I rebase my PR.

$ rustc +stable --version
rustc 1.25.0 (84203cac6 2018-03-25)
$ cargo +stable fmt --version
0.3.8-nightly (346238f 2018-02-04)

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.

None yet

3 participants