cornelli 1.4.2

Write to your future self.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::path::PathBuf;

use anyhow::{Result, bail};

pub fn get_database_path() -> Result<PathBuf> {
    let db_path = match dirs::config_dir() {
        Some(path) => path.join("cornelli/christmas.json"),
        None => {
            bail!("Storage couldn't be determined.");
        }
    };

    Ok(db_path)
}