trello-to-deck/src/config.rs
Paul Campbell 6552a413da
Some checks failed
Test / build (map[name:stable]) (push) Successful in 1m43s
Test / build (map[name:nightly]) (push) Successful in 2m8s
Release Please / Release-plz (push) Failing after 58s
refactor: reshuffling and extracting Executor trait
2024-12-13 21:59:28 +00:00

19 lines
555 B
Rust

//
use color_eyre::Result;
use crate::{f, nextcloud::NextcloudConfig, s, trello::TrelloConfig, Ctx, NAME};
#[derive(
Clone, Debug, derive_more::From, PartialEq, Eq, derive_more::AsRef, serde::Deserialize,
)]
pub(crate) struct AppConfig {
pub(crate) trello: TrelloConfig,
pub(crate) nextcloud: NextcloudConfig,
}
impl AppConfig {
pub(crate) fn load(ctx: &Ctx) -> Result<Self> {
let file = ctx.fs.base().join(f!("{NAME}.toml"));
let str = ctx.fs.file(&file).reader()?;
Ok(toml::from_str(s!(str).as_str())?)
}
}