Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Replace direct use of once_cell to std #5627

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

Merged
merged 2 commits into from
Mar 27, 2025

Conversation

youknowone
Copy link
Member

No description provided.

@youknowone youknowone changed the title Replace direct use of once_cell Replace direct use of once_cell to std Mar 26, 2025
@youknowone youknowone requested a review from Copilot March 27, 2025 04:30
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR replaces the direct use of once_cell with the standard library's lazy primitives.

  • Update once_cell::sync::Lazy to std::sync::LazyLock in multiple modules.
  • Change OnceCell to OnceLock in the uuid module.
  • Remove once_cell dependency from Cargo.toml files.

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.

Show a summary per file
File Description
vm/src/stdlib/sre.rs Replaced once_cell usage with std::sync::LazyLock for mapping methods.
vm/src/builtins/weakproxy.rs Updated Lazy to LazyLock for sequence methods.
vm/src/builtins/union.rs Changed Lazy to LazyLock for mapping methods.
vm/src/builtins/tuple.rs Replaced once_cell imports with std::sync::LazyLock for mapping and sequence methods.
vm/src/builtins/str.rs Updated Lazy to LazyLock for mapping and sequence methods.
vm/src/builtins/set.rs Replaced once_cell with std::sync::LazyLock for sequence methods.
vm/src/builtins/range.rs Changed Lazy to LazyLock for both mapping and sequence methods.
vm/src/builtins/memory.rs Replaced once_cell usage with std::sync::LazyLock in sequence methods.
vm/src/builtins/mappingproxy.rs Updated Lazy to LazyLock for mapping and sequence methods.
vm/src/builtins/genericalias.rs Changed Lazy to LazyLock for mapping methods.
vm/src/builtins/dict.rs Replaced once_cell with std::sync::LazyLock in sequence methods.
vm/src/builtins/bytes.rs Updated Lazy to LazyLock in mapping and sequence methods.
stdlib/src/uuid.rs Replaced OnceCell with OnceLock for node ID caching.
stdlib/src/sqlite.rs Changed once_cell::sync::Lazy to std::sync::LazyLock for mapping and sequence methods.
stdlib/src/mmap.rs Replaced local once_cell usage with std::sync::LazyLock.
stdlib/src/csv.rs Updated once_cell::sync::Lazy to std::sync::LazyLock in global static initialization.
stdlib/src/contextvars.rs Changed once_cell to std::sync::LazyLock in sequence methods.
stdlib/Cargo.toml Removed once_cell dependency.
derive-impl/src/compile_bytecode.rs Updated once_cell::sync::Lazy to std::sync::LazyLock for manifest directory.
derive-impl/Cargo.toml Removed once_cell dependency.

@coolreader18 coolreader18 merged commit bea25a0 into RustPython:main Mar 27, 2025
11 checks passed
@youknowone youknowone deleted the once-cell branch March 27, 2025 04:38
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.