Major update
too lazy to describe
This commit is contained in:
29
xmpd-settings/src/cache.rs
Normal file
29
xmpd-settings/src/cache.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
use camino::Utf8PathBuf;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Cache {
|
||||
#[serde(default="Cache::default_cache_path")]
|
||||
pub cache_path: Utf8PathBuf,
|
||||
#[serde(default="Cache::default_manifest_path")]
|
||||
pub manifest_path: Utf8PathBuf,
|
||||
}
|
||||
|
||||
impl Default for Cache {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
cache_path: Self::default_cache_path(),
|
||||
manifest_path: Self::default_manifest_path(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Cache {
|
||||
fn default_cache_path() -> Utf8PathBuf {
|
||||
Utf8PathBuf::from("./cache")
|
||||
}
|
||||
fn default_manifest_path() -> Utf8PathBuf {
|
||||
Utf8PathBuf::from("./manifest.json")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user