bitque/shared/jirs-config/src/hi.rs
2021-01-13 22:16:22 +01:00

27 lines
529 B
Rust

use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
pub struct Configuration {
pub concurrency: usize,
#[serde(default = "Configuration::default_theme")]
pub theme: String,
}
impl Default for Configuration {
fn default() -> Self {
Self {
concurrency: 2,
theme: Self::default_theme(),
}
}
}
impl Configuration {
crate::rw!("highlight.toml");
fn default_theme() -> String {
"Github".to_string()
}
}
crate::read!(Configuration);