Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

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

Merged
dzhou121 merged 3 commits intolapce:mainfrom
sgued:remove-lazy
Aug 10, 2024
Merged

Remove the use of LazyLock in places where it's not necessary#546
dzhou121 merged 3 commits intolapce:mainfrom
sgued:remove-lazy

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
@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