2020-12-24 16:24:04 +01:00
|
|
|
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,
|
2020-12-24 16:24:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for Configuration {
|
|
|
|
fn default() -> Self {
|
2021-01-13 22:16:22 +01:00
|
|
|
Self {
|
|
|
|
concurrency: 2,
|
|
|
|
theme: Self::default_theme(),
|
|
|
|
}
|
2020-12-24 16:24:04 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Configuration {
|
2021-01-06 18:47:54 +01:00
|
|
|
crate::rw!("highlight.toml");
|
2021-01-13 22:16:22 +01:00
|
|
|
|
|
|
|
fn default_theme() -> String {
|
|
|
|
"Github".to_string()
|
|
|
|
}
|
2020-12-24 16:24:04 +01:00
|
|
|
}
|
2021-01-06 18:47:54 +01:00
|
|
|
crate::read!(Configuration);
|