Skip to content

Replace once_cell with LazyLock in codegen #4105

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FalkWoldmann
Copy link
Contributor

Motivation and Context

Since Rust 1.80, the once_cell::sync::Lazy functionality is available in the std via sync::LazyLock (see #4050).

Description

I removed the references to the once_cell crate and replaced the usage in the codegen part with LazyLock

Testing

I ran the codegen tests as described in the readme locally (M1 mac), which were successful. I also rg'ed on the generated code and found no usages of once_cell.

Checklist

  • For changes to the smithy-rs codegen or runtime crates, I have created a changelog entry Markdown file in the .changelog directory, specifying "client," "server," or both in the applies_to key.
  • For changes to the AWS SDK, generated SDK code, or SDK runtime crates, I have created a changelog entry Markdown file in the .changelog directory, specifying "aws-sdk-rust" in the applies_to key.

Open questions

  • I made this a draft since I'm not quite sure whether this is the correct approach, as I'm not familiar with the code, so I'll be happy about feedback!
  • I could also remove the lazy_static dependency or do it in a separate PR, whatever you prefer

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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.

1 participant