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

Replace lazy_static with once_cell #1758

Merged
merged 1 commit into from
May 8, 2023

Conversation

tottoto
Copy link
Contributor

@tottoto tottoto commented May 7, 2023

Replaces lazy_static with once_cell as once_cell is without macros and it will go to standard library.

@codecov-commenter
Copy link

codecov-commenter commented May 7, 2023

Codecov Report

Patch coverage: 50.00% and project coverage change: -0.02 ⚠️

Comparison is base (9e64618) 29.44% compared to head (1aec4c6) 29.43%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1758      +/-   ##
==========================================
- Coverage   29.44%   29.43%   -0.02%     
==========================================
  Files          49       49              
  Lines       17594    17609      +15     
  Branches     8493     8494       +1     
==========================================
+ Hits         5181     5183       +2     
- Misses       7257     7317      +60     
+ Partials     5156     5109      -47     
Impacted Files Coverage Δ
src/config.rs 28.55% <0.00%> (-0.23%) ⬇️
src/dist/client_auth.rs 0.00% <0.00%> (ø)
src/dist/http.rs 0.00% <ø> (ø)
src/compiler/c.rs 36.48% <100.00%> (+0.20%) ⬆️
src/compiler/rust.rs 32.39% <100.00%> (-0.68%) ⬇️

... and 11 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tottoto tottoto force-pushed the replace-lazy-static-with-once-cell branch from 2eaab66 to 1aec4c6 Compare May 7, 2023 22:22
@Xuanwo
Copy link
Collaborator

Xuanwo commented May 8, 2023

Thanks!

@Xuanwo Xuanwo merged commit 4f7e7f4 into mozilla:main May 8, 2023
@tottoto tottoto deleted the replace-lazy-static-with-once-cell branch May 8, 2023 10:59
static ref CACHED_CONFIG: Mutex<Option<CachedFileConfig>> = Mutex::new(None);
}
static CACHED_CONFIG_PATH: Lazy<PathBuf> = Lazy::new(CachedConfig::file_config_path);
static CACHED_CONFIG: Lazy<Mutex<Option<CachedFileConfig>>> = Lazy::new(|| Mutex::new(None));
Copy link

Choose a reason for hiding this comment

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

Mutex::new is const since Rust 1.63 and #1702 bumped sccache's MSRV to 1.64 three months ago so this can be simplified further I think 🙂

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.

4 participants