Repository navigation
refactor: replace lazy_static with LazyLock - #3244
Merged
Merged
Conversation
TaKO8Ki
marked this pull request as draft
July 27, 2026 14:31
TaKO8Ki
marked this pull request as ready for review
July 27, 2026 14:31
KuSh
reviewed
Jul 27, 2026
| static ref S3_TRANSFER_RE: Regex = Regex::new(r"^(upload|download|delete|copy|move):").unwrap(); | ||
| } | ||
| static S3_TRANSFER_RE: LazyLock<Regex> = | ||
| LazyLock::new(|| Regex::new(r"^(upload|download|delete|copy|move):").unwrap()); |
Collaborator
There was a problem hiding this comment.
This might be a good opportunity to replace "unwrap" with "expect.
Collaborator
Author
There was a problem hiding this comment.
So is it better to replace all uses of unwrap with expect in this pr?
aeppling
requested changes
Jul 27, 2026
aeppling
left a comment
Contributor
There was a problem hiding this comment.
just some agent docs in .claude that will misslead some coding agent if used (still enforcing lazy_static)
TaKO8Ki
force-pushed
the
refactor/replace-lazy-static
branch
from
July 27, 2026 17:20
31e9e10 to
ae07b4b
Compare
Collaborator
Author
|
@aeppling I have updated the agent docs. |
aeppling
approved these changes
Jul 27, 2026
Merged
2 tasks done
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Since
LazyLockhas been stable since Rust 1.80 and RTK's MSRV is Rust 1.91, there is no longer a project-specific reason to use the external lazy_static macro. In addition, #3249 removed nested lazy_static dependency by updating colored crate.lazy_static!declarations withstd::sync::LazyLockwithout intended behavior changes.lazy_staticdependency and update related documentation.dead_codechecks.Test plan
cargo fmt --all && cargo clippy --all-targets && cargo testrtk <command>output inspected