fix: build without tokio feature
This commit is contained in:
parent
4c4abd939e
commit
b01f4ff422
3 changed files with 18 additions and 4 deletions
|
|
@ -87,11 +87,19 @@ winit_wgpu = ["winit", "wgpu"]
|
||||||
xdg-portal = ["ashpd"]
|
xdg-portal = ["ashpd"]
|
||||||
qr_code = ["iced/qr_code"]
|
qr_code = ["iced/qr_code"]
|
||||||
markdown = ["iced/markdown"]
|
markdown = ["iced/markdown"]
|
||||||
|
async-std = [
|
||||||
|
"dep:async-std",
|
||||||
|
"ashpd/async-std",
|
||||||
|
"rfd?/async-std",
|
||||||
|
"zbus?/async-io",
|
||||||
|
"iced/async-std",
|
||||||
|
]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
apply = "0.3.0"
|
apply = "0.3.0"
|
||||||
ashpd = { version = "0.9.1", default-features = false, optional = true }
|
ashpd = { version = "0.9.1", default-features = false, optional = true }
|
||||||
async-fs = { version = "2.1", optional = true }
|
async-fs = { version = "2.1", optional = true }
|
||||||
|
async-std = { version = "1.10", optional = true }
|
||||||
cctk = { git = "https://github.com/pop-os/cosmic-protocols", package = "cosmic-client-toolkit", rev = "178eb0b", optional = true }
|
cctk = { git = "https://github.com/pop-os/cosmic-protocols", package = "cosmic-client-toolkit", rev = "178eb0b", optional = true }
|
||||||
chrono = "0.4.35"
|
chrono = "0.4.35"
|
||||||
cosmic-config = { path = "cosmic-config" }
|
cosmic-config = { path = "cosmic-config" }
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use ashpd::desktop::settings::{ColorScheme, Contrast};
|
use ashpd::desktop::settings::{ColorScheme, Contrast};
|
||||||
use ashpd::desktop::Color;
|
use ashpd::desktop::Color;
|
||||||
use iced::futures::{self, select, FutureExt, SinkExt, StreamExt};
|
use iced::futures::{self, select, FutureExt, SinkExt, StreamExt};
|
||||||
use iced_futures::{stream, subscription};
|
use iced_futures::stream;
|
||||||
use tracing::error;
|
use tracing::error;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
@ -27,7 +27,7 @@ pub fn desktop_settings() -> iced_futures::Subscription<Desktop> {
|
||||||
.await;
|
.await;
|
||||||
#[cfg(not(feature = "tokio"))]
|
#[cfg(not(feature = "tokio"))]
|
||||||
{
|
{
|
||||||
pending::<()>().await;
|
futures::future::pending::<()>().await;
|
||||||
unreachable!();
|
unreachable!();
|
||||||
}
|
}
|
||||||
attempts += 1;
|
attempts += 1;
|
||||||
|
|
|
||||||
|
|
@ -483,8 +483,14 @@ pub fn update<'a, Message: Clone + 'static, TopLevelMessage: Clone + 'static>(
|
||||||
let view = view.clone();
|
let view = view.clone();
|
||||||
let is_hovered = is_hovered.clone();
|
let is_hovered = is_hovered.clone();
|
||||||
Task::future(async move {
|
Task::future(async move {
|
||||||
_ = tokio::time::sleep(delay).await;
|
#[cfg(feature = "tokio")]
|
||||||
|
{
|
||||||
|
_ = tokio::time::sleep(delay).await;
|
||||||
|
}
|
||||||
|
#[cfg(feature = "async-std")]
|
||||||
|
{
|
||||||
|
_ = async_std::task::sleep(delay).await;
|
||||||
|
}
|
||||||
let is_hovered = is_hovered.clone();
|
let is_hovered = is_hovered.clone();
|
||||||
let g = is_hovered.lock().unwrap();
|
let g = is_hovered.lock().unwrap();
|
||||||
if !*g {
|
if !*g {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue