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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion backends/gstreamer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ gst-webrtc = { workspace = true }
gst-sdp = { workspace = true }
gstreamer-sys = { workspace = true }
ipc-channel = { workspace = true }
lazy_static = "1.2.0"
log = "0.4"
mime = "0.3.13"
once_cell = "1.18.0"
Expand Down
1 change: 0 additions & 1 deletion streams/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ name = "servo_media_streams"
path = "lib.rs"

[dependencies]
lazy_static = "1.0"
uuid = { version = "1.4", features = ["v4"] }
3 changes: 0 additions & 3 deletions streams/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#[macro_use]
extern crate lazy_static;

pub mod capture;
pub mod device_monitor;
pub mod registry;
Expand Down
11 changes: 6 additions & 5 deletions streams/registry.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use super::MediaStream;
use std::collections::HashMap;
use std::sync::{Arc, Mutex};
use std::sync::{Arc, LazyLock, Mutex};
use uuid::Uuid;

lazy_static! {
static ref MEDIA_STREAMS_REGISTRY: Mutex<HashMap<MediaStreamId, Arc<Mutex<dyn MediaStream>>>> =
Mutex::new(HashMap::new());
}
type RegisteredMediaStream = Arc<Mutex<dyn MediaStream>>;

static MEDIA_STREAMS_REGISTRY: LazyLock<Mutex<HashMap<MediaStreamId, RegisteredMediaStream>>> = LazyLock::new(|| {
Mutex::new(HashMap::new())
});

#[derive(Clone, Copy, Hash, Eq, PartialEq)]
pub struct MediaStreamId(Uuid);
Expand Down
3 changes: 1 addition & 2 deletions webrtc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ edition = "2021"
path = "lib.rs"

[dependencies]
lazy_static = "1.0"
log = "0.4.6"
log = "0.4"
uuid = { version = "1.4", features = ["v4"] }

[dependencies.servo-media-streams]
Expand Down
Loading