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

fix clippy linting recommendations (edition 2018) #581

Merged

Conversation

chetaldrich
Copy link
Contributor

Figured I'd start with recommendations in the current codebase as is, and that'll make handling #553 a bit easier.

@LucioFranco
Copy link
Member

@chetaldrich looks like you may need to run rustfmt, ci is failing.

@chetaldrich
Copy link
Contributor Author

Ok, I'll give that a go quick. Thanks for getting the CI to run!

@chetaldrich
Copy link
Contributor Author

@LucioFranco I ran rustfmt, so should be good to give CI another run.

It turns out you get a compilation error on Rust 1.51.0 if you use the `split_once` and `rsplit_once` methods since they were unstable at that version.

In Rust stable (currently 1.58.1), there are clippy recommendations that
say to use those methods instead of `rsplitn` and `splitn` if you're only splitting once.

I figured the best way to handle this since we're targeting 1.51 in addition to stable is to just set specific ignore in that case so the old version still compiles successfully.
@chetaldrich
Copy link
Contributor Author

It turns out you get a compilation error on Rust 1.51.0 if you use the split_once and rsplit_once methods since they were unstable at that version.

In Rust stable (currently 1.58.1), there are clippy recommendations that
say to use those methods instead of rsplitn and splitn if you're only splitting once.

I figured the best way to handle this since we're targeting 1.51 in addition to stable is to just set specific ignore in that case so the old version still compiles successfully.

Should be good for another CI run @LucioFranco, thanks for being prompt about the last one!

@chetaldrich
Copy link
Contributor Author

Looks like we're good now! If you have any other comments @LucioFranco let me know.

@LucioFranco LucioFranco merged commit afdc4c9 into tokio-rs:master Feb 21, 2022
@chetaldrich chetaldrich deleted the chetaldrich/clippy-fixes-edition-2018 branch February 21, 2022 16:15
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