-
-
Notifications
You must be signed in to change notification settings - Fork 293
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
Upgrade to Rust 2021 Edition #340
Conversation
The CI failure appears to be because your github workflow relies on the default installed cargo. As of time of writing this comment, the ubuntu image github actions uses is on Rust 1.55.0 (one version older than current), but that'll likely change soon as versions get bumped pretty often. If you need a more short-term solution, using the Rust toolchain action will allow you to control this (use a newer one than github provides, pin a minimum Rust version, etc.) |
And honestly I couldn't tell you why only one of the jobs seems to have this issue, they really all should be failing with the same error. |
Sounds like we should wait a bit before merging, waiting for tools to settle, then? |
Sounds good to me. Looks like actions/runner-images#4324 is tracking this, and should be fixed in a bit over a week when the environment gets updated. I'll rebase the PR at that point if there's any merge conflicts and then let you know to rerun CI. |
let port: u16 = std::env::args() | ||
.nth(2) | ||
.unwrap_or("1337".into()) | ||
.unwrap_or_else(|| "1337".into()) | ||
.parse::<u16>() | ||
.unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider doing it this way, avoiding a string allocation and runtime parsing the default case:
let port: u16 = std::env::args()
.nth(2)
.map(|port| port.parse().unwrap()) // if an arg is provided, parse as u16 and panic on fail
.unwrap_or(1337); // since the value is constant, no need for runtime calculation using a closure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I know that's not the point of this PR, but since I was looking anyway)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nah that's not really important, it's code in a test executed just one time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was actually what I was originally going to do but I didn't want to descend too heavily into actual code cleanup/changes, and mostly just wanted to make sure things weren't in a worse state clippy-wise than before
Ty! We will wait for #341 and then merge this one after solving the CI issues. |
* Enable missing const_xxh3 feature * Move to Rust 2021 Edition * Fix clippy complaints * Remove imports made unecessary in 2021 edition
Closes #337, cc @andreafioraldi for review.