rustash 0.1.1

a simple CLI tool to manage your notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use dirs;
use std::fs::File;
use std::path::PathBuf;

pub fn get_json() -> PathBuf {
    let home_dir = dirs::home_dir().expect("could not find home directory");
    let mut file_path = PathBuf::from(home_dir);
    file_path.push(".rustash.json");
    return file_path;
}

pub fn open_file(file_path: PathBuf) -> File {
    return File::open(file_path).expect("could not open file");
}

pub fn create_file(file_path: PathBuf) -> File {
    return File::create(file_path).expect("could not create file");
}