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 dependency on lazy_static #431

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

simonwuelker
Copy link
Contributor

The gstreamer/webrtc crates were depending
on lazy_static, but not using it.

In the case of the streams crate, lazy_static
can be replaced by the LazyLock struct from
the standard library.
(https://doc.rust-lang.org/std/sync/struct.LazyLock.html)

The gstreamer/webrtc crates were depending
on lazy_static, but not using it.

In the case of the streams crate, lazy_static
can be replaced by the LazyLock struct from
the standard library.
(https://doc.rust-lang.org/std/sync/struct.LazyLock.html)

Signed-off-by: Simon Wülker <[email protected]>
Copy link

@nicoburns nicoburns left a comment

Choose a reason for hiding this comment

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

Nice. There's a bunch of these across the Servo codebase! It's a shame it's a HashMap. If it was a type with a const constructor like a BTreeMap or a Vec then you could get rid of the LazyLock entirely.

@simonwuelker
Copy link
Contributor Author

Yeah, I was surprised seeing that HashMap::new is not const

@simonwuelker simonwuelker added this pull request to the merge queue Jan 19, 2025
Merged via the queue into servo:main with commit 4c24b9f Jan 19, 2025
3 checks passed
@simonwuelker simonwuelker deleted the begone-lazy-static branch January 19, 2025 02:16
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