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

style: use strip_prefix instead of manual starts_with/slice #309

Merged
merged 1 commit into from
May 29, 2024

Conversation

yhx-12243
Copy link
Contributor

strip_prefix is stable since 1.45.0, which is less than the MSRV (1.60) of this crate, and it generally generates better code.

@cuviper
Copy link
Member

cuviper commented May 29, 2024

I'm surprised clippy didn't see this, but maybe it only lints if there's a manual len() too.
https://rust-lang.github.io/rust-clippy/master/#/manual_strip

Thanks!

@cuviper cuviper added this pull request to the merge queue May 29, 2024
Merged via the queue into rust-num:master with commit 124eac8 May 29, 2024
4 checks passed
@yhx-12243
Copy link
Contributor Author

I'm surprised clippy didn't see this, but maybe it only lints if there's a manual len() too. https://rust-lang.github.io/rust-clippy/master/#/manual_strip

Thanks!

Yes I've already proposed at rust-lang/rust-clippy#12863. 👀

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