Skip to content
Open
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
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ include = [

[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
dbus = { version = "0.9", optional = true }
lazy_static = { version = "1.5", optional = true }
image = { version = "0.25", optional = true }
zbus = { version = "5", optional = true, default-features = false }
serde = { version = "1", optional = true }
Expand All @@ -47,7 +46,8 @@ z-with-tokio = ["zbus", "serde", "tokio"]
async = ["zbus/async-io"]
tokio = ["zbus/tokio"]
debug_namespace = []
images = ["image", "lazy_static"]
images = ["image"]
lazy_static= [] # inert, here for backward compait, remove with next breaking change

[dev-dependencies]
color-backtrace = "0.7" # wait for MSVR 1.70 to update
Expand Down
16 changes: 6 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ extern crate mac_notification_sys;
#[cfg(target_os = "windows")]
extern crate winrt_notification;

#[macro_use]
#[cfg(all(feature = "images", unix, not(target_os = "macos")))]
extern crate lazy_static;

pub mod error;
mod hints;
mod miniver;
Expand Down Expand Up @@ -212,13 +208,13 @@ pub use crate::urgency::Urgency;
pub use crate::{notification::Notification, timeout::Timeout};

#[cfg(all(feature = "images", unix, not(target_os = "macos")))]
lazy_static! {
/// Read once at runtime. Needed for Images
pub static ref SPEC_VERSION: miniver::Version =
get_server_information()
/// Read once at runtime. Needed for Images
pub static SPEC_VERSION: std::sync::LazyLock<miniver::Version> = std::sync::LazyLock::new(|| {
get_server_information()
.and_then(|info| info.spec_version.parse::<miniver::Version>())
.unwrap_or_else(|_| miniver::Version::new(1,1));
}
.unwrap_or_else(|_| miniver::Version::new(1, 1))
});

/// Return value of `get_server_information()`.
#[derive(Debug)]
pub struct ServerInformation {
Expand Down
Loading