bitque/shared/jirs-config/src/hi.rs

27 lines
529 B
Rust
Raw Normal View History

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