Skip to content

Commit

Permalink
Drop once_cell dependency
Browse files Browse the repository at this point in the history
The bump of msrv to 1.70 is okay, as we will be updating soon to
zbus 4 (once released) which requires 1.75
  • Loading branch information
bilelmoussaoui committed Jan 27, 2024
1 parent e58cba6 commit 0580c74
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MIT"
name = "ashpd"
repository = "https://github.com/bilelmoussaoui/ashpd"
version = "0.7.0"
rust-version = "1.65"
rust-version = "1.70"

[features]
async-std = ["zbus/async-io", "dep:async-fs", "dep:async-net"]
Expand All @@ -32,7 +32,6 @@ gdk4wayland = { git = "https://github.com/gtk-rs/gtk4-rs", package = "gdk4-wayla
gdk4x11 = { git = "https://github.com/gtk-rs/gtk4-rs", package = "gdk4-x11", version = "0.8", optional = true }
gtk4 = { git = "https://github.com/gtk-rs/gtk4-rs", version = "0.8", optional = true }
libc = { version = "0.2", optional = true }
once_cell = "1.14"
pw = { package = "pipewire", version = "0.7", optional = true }
rand = { version = "0.8", default-features = false }
raw-window-handle = { version = "0.6", optional = true }
Expand Down
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ compile_error!("You can't enable both async-std & tokio features at once");
/// Alias for a [`Result`] with the error type `ashpd::Error`.
pub type Result<T> = std::result::Result<T, Error>;

static IS_SANDBOXED: OnceCell<bool> = OnceCell::new();
static IS_SANDBOXED: OnceLock<bool> = OnceLock::new();

/// Interact with the user's desktop such as taking a screenshot, setting a
/// background or querying the user's location.
Expand All @@ -34,8 +34,9 @@ mod proxy;
/// received an update & install it.
pub mod flatpak;
mod helpers;
use std::sync::OnceLock;

pub use enumflags2;
use once_cell::sync::OnceCell;
pub use url;
pub use zbus::{self, zvariant};

Expand Down
5 changes: 2 additions & 3 deletions src/proxy.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{fmt::Debug, future::ready, ops::Deref};
use std::{fmt::Debug, future::ready, ops::Deref, sync::OnceLock};

use futures_util::{Stream, StreamExt};
use once_cell::sync::OnceCell;
use serde::{Deserialize, Serialize};
use zbus::zvariant::{ObjectPath, OwnedValue, Type};
#[cfg(feature = "tracing")]
Expand All @@ -24,7 +23,7 @@ pub(crate) const FLATPAK_PATH: &str = "/org/freedesktop/portal/Flatpak";
pub(crate) const FLATPAK_DEVELOPMENT_DESTINATION: &str = "org.freedesktop.Flatpak";
pub(crate) const FLATPAK_DEVELOPMENT_PATH: &str = "/org/freedesktop/Flatpak/Development";

static SESSION: OnceCell<zbus::Connection> = OnceCell::new();
static SESSION: OnceLock<zbus::Connection> = OnceLock::new();

#[derive(Debug)]
pub struct Proxy<'a> {
Expand Down

0 comments on commit 0580c74

Please # to comment.