cuprated/config/
fs.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use std::path::PathBuf;

use serde::{Deserialize, Serialize};

use cuprate_helper::fs::{CUPRATE_CACHE_DIR, CUPRATE_DATA_DIR};

#[derive(Debug, Deserialize, Serialize, PartialEq, Eq)]
#[serde(deny_unknown_fields, default)]
pub struct FileSystemConfig {
    pub data_directory: PathBuf,
    pub cache_directory: PathBuf,
}

impl Default for FileSystemConfig {
    fn default() -> Self {
        Self {
            data_directory: CUPRATE_DATA_DIR.to_path_buf(),
            cache_directory: CUPRATE_CACHE_DIR.to_path_buf(),
        }
    }
}