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

Use std::ops::Range instead of a custom type #556

Merged
merged 1 commit into from
Apr 15, 2022

Conversation

alexcrichton
Copy link
Member

This commit removes wasmparser::Range and instead uses
std::ops::Range<usize> instead. This is inspired by review on
bytecodealliance/wasmtime#4005 where it's more convenience to have all
the libstd methods available.

This commit removes `wasmparser::Range` and instead uses
`std::ops::Range<usize>` instead. This is inspired by review on
bytecodealliance/wasmtime#4005 where it's more convenience to have all
the libstd methods available.
@fitzgen
Copy link
Member

fitzgen commented Apr 15, 2022

What if we just had

pub type Range = std::ops::Range<usize>;

in src/lib.rs?

@fitzgen
Copy link
Member

fitzgen commented Apr 15, 2022

That should cut down churn both in this PR and for downstream crates.

@alexcrichton
Copy link
Member Author

I personally find typedefs like that confusing unless they're well-known which I figure this one probably won't be. I would hope that there wouldn't be too much churn for downstream consumers since this type isn't so common to work with, but are you thinking it'll have a bigger impact?

@fitzgen
Copy link
Member

fitzgen commented Apr 15, 2022

Nah it was just an idea. We can go ahead with this.

@fitzgen fitzgen merged commit ff5025e into bytecodealliance:main Apr 15, 2022
@alexcrichton alexcrichton deleted the use-std-range-type branch July 6, 2022 14:28
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.

2 participants