From 534193b3ed61e62b271120d2d2f5e85988752136 Mon Sep 17 00:00:00 2001 From: Polesznyák Márk Date: Sun, 4 Jan 2026 02:40:38 +0100 Subject: chore: replace tokio with smol, disable unneeded iced feature flags --- src/config.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index 98140e6..48e4323 100644 --- a/src/config.rs +++ b/src/config.rs @@ -6,8 +6,7 @@ use std::sync::Arc; use iced_material::Theme; use serde::{Deserialize, Serialize}; -use tokio_stream::StreamExt; -use tokio_stream::wrappers::ReadDirStream; +use smol::fs; use crate::appearance::Appearance; use crate::{Error, environment}; @@ -63,8 +62,6 @@ impl Config { } pub async fn load() -> Result { - use tokio::fs; - let path = Self::config_file_path(); if !path.try_exists()? { Self::default() @@ -94,7 +91,7 @@ impl Config { pub async fn load_appearance( theme_name: &str, ) -> Result { - use tokio::fs; + use smol::stream::StreamExt; let read_entry = async move |entry: fs::DirEntry| { let content = fs::read_to_string(entry.path()).await.ok()?; @@ -113,8 +110,7 @@ impl Config { selected = Theme::ALL[index].clone(); } - let mut stream = - ReadDirStream::new(fs::read_dir(Self::themes_dir()).await?); + let mut stream = fs::read_dir(Self::themes_dir()).await?; while let Some(entry) = stream.next().await { let Ok(entry) = entry else { continue; @@ -135,8 +131,7 @@ impl Config { } pub async fn save(self) -> Result<(), Error> { - use tokio::fs; - use tokio::io::AsyncWriteExt; + use smol::io::AsyncWriteExt; let mut file = fs::File::create(Self::config_file_path()).await?; -- cgit v1.2.3