25 lines
459 B
Rust
25 lines
459 B
Rust
|
//
|
||
|
use color_eyre::Result;
|
||
|
|
||
|
use crate::{f, s, Ctx, NAME};
|
||
|
|
||
|
#[derive(
|
||
|
Clone,
|
||
|
Debug,
|
||
|
derive_more::From,
|
||
|
PartialEq,
|
||
|
Eq,
|
||
|
PartialOrd,
|
||
|
Ord,
|
||
|
derive_more::AsRef,
|
||
|
serde::Deserialize,
|
||
|
)]
|
||
|
pub struct AppConfig {}
|
||
|
impl AppConfig {
|
||
|
pub 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())?)
|
||
|
}
|
||
|
}
|