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

Update: modernize to rust 1.65 #337

Merged
merged 9 commits into from
Dec 18, 2022
Merged

Update: modernize to rust 1.65 #337

merged 9 commits into from
Dec 18, 2022

Conversation

jrconlin
Copy link
Member

  • use workspace cargo dependencies to ensure crate/meta consistency
  • update libraries and calls
  • include -A dead_code to clippy to get around future_state_machine
  • modern fmt/clippy recommendations

* use workspace cargo dependencies to ensure crate/meta consistency
* update libraries and calls
* include `-A dead_code` to clippy to get around `future_state_machine`
* modern fmt/clippy recommendations
@jrconlin jrconlin requested review from pjenvey, ethowitz and a team December 13, 2022 18:43
* Add local overrides to contract test script for local testing
]
edition = "2021"

[workspace.dependencies]
Copy link
Member

Choose a reason for hiding this comment

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

Cool, I hadn't even noticed this stuff in the 1.64 release notes. cc: @ethowitz

Copy link

@ethowitz ethowitz Dec 14, 2022

Choose a reason for hiding this comment

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

This is neat! I'll definitely use this on the syncstorage crate reorg

@@ -92,6 +92,7 @@ impl Tags {
}
}

/*
Copy link
Member

Choose a reason for hiding this comment

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

Why commented out, is this just not used in autoendpoint?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's commented out because the slog::Key::from(key.clone()) no longer produces a string that is equivalent to `static. I'd like to eventually return the function, but for now, I've gone and converted the Keys to a formatted value.

Copy link
Member

Choose a reason for hiding this comment

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

This really confused me after seeing the slog::Key docs state it implements impl From<String> for Key -- turns out it only really uses the "dynamic" version of Key when the dynamic-keys feature flag is enabled, which we're missing. So switching it back on should let us uncomment this again.

let encoding = if public_key.contains(['/', '+']) {
base64::STANDARD_NO_PAD
let engine = if public_key.contains(['/', '+']) {
base64::engine::fast_portable::FastPortable::from(
Copy link
Member

Choose a reason for hiding this comment

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

Let's take advantage of FastPortable::from being a const method and make all them constants (at least outside of tests, also have some in endpoint.rs and notification.rs), its docs recommend it even though they're not very expensive to construct.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, cool! Didn't see that in the docs. I was mostly just focused on getting the stuff working.

@jrconlin jrconlin requested a review from pjenvey December 14, 2022 23:41
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.

3 participants