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

Remove the use of LazyLock in places where it's not necessary #546

Merged
merged 3 commits into from
Aug 10, 2024

Conversation

sgued
Copy link
Contributor

@sgued sgued commented Aug 10, 2024

Mutex::new has been const on stable for a while so it can be used without the need for Lazy.

The use of once_cell::Lazy has also been replaced by the recently stabilized std version, that is already used somewhere else so there is no MSRV bump.

This PR also makes ExtEventHandler private (which is a breaking change), but this structure is only ever used in a private static and should not have been made public from the start (unless we also make the static public).

sgued added 3 commits August 10, 2024 21:28
This is a breaking change because it removes the (unused) implementation of `ExtEventHandler`,
but this structure was only ever used in a private static and should not have been exposed as part of the public API
(unless we make the EXT_EVENT_HANDLER public too)
@dzhou121 dzhou121 merged commit 908c3f3 into lapce:main Aug 10, 2024
7 checks passed
@panekj
Copy link
Collaborator

panekj commented Aug 10, 2024

The MSRV still needs to be bumped, since std LazyLock is 1.80

@sgued
Copy link
Contributor Author

sgued commented Aug 10, 2024

LazyLock was already used before this PR in the renderer crate: 

use std::{ops::Range, sync::LazyLock};

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