30 lines
704 B
Rust
30 lines
704 B
Rust
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")
|
|
}
|
|
}
|