refactor(cosmic-config-derive): add support for types with generic parameters
This commit is contained in:
parent
b064293632
commit
b82b6566f1
4 changed files with 23 additions and 6 deletions
|
|
@ -6,7 +6,7 @@ edition = "2021"
|
|||
[features]
|
||||
default = ["macro", "subscription"]
|
||||
macro = ["cosmic-config-derive"]
|
||||
subscription = ["iced", "iced_futures"]
|
||||
subscription = ["iced_futures"]
|
||||
|
||||
[dependencies]
|
||||
atomicwrites = "0.4.0"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#[cfg(feature = "subscription")]
|
||||
use iced::subscription;
|
||||
#[cfg(feature = "subscription")]
|
||||
use iced_futures::futures::channel::mpsc;
|
||||
#[cfg(feature = "subscription")]
|
||||
use iced_futures::subscription;
|
||||
use notify::{RecommendedWatcher, Watcher};
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
use std::{
|
||||
|
|
@ -277,7 +277,7 @@ pub enum ConfigUpdate<T> {
|
|||
|
||||
pub trait CosmicConfigEntry
|
||||
where
|
||||
Self: Sized + Default,
|
||||
Self: Sized,
|
||||
{
|
||||
fn write_entry(&self, config: &Config) -> Result<(), crate::Error>;
|
||||
fn get_entry(config: &Config) -> Result<Self, (Vec<crate::Error>, Self)>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue