Starting to modify things into container structs

This commit is contained in:
Dave Hrycyszyn
2024-06-07 17:03:05 +01:00
parent b1f5d2b75a
commit a81d1f913a
5 changed files with 100 additions and 55 deletions

View File

@@ -3,7 +3,7 @@ use std::path::PathBuf;
pub(crate) const KEY_FILE: &str = "keys.pem";
pub(crate) const CONFIG_FILE: &str = "config.toml";
/// Returns the path to the key file for this host OS.
/// Returns the path to the key file and config for this host OS.
pub(crate) fn side_paths(prefix: PathBuf) -> (PathBuf, PathBuf) {
let mut key_path = prefix.clone();
key_path.push(KEY_FILE);
@@ -13,3 +13,10 @@ pub(crate) fn side_paths(prefix: PathBuf) -> (PathBuf, PathBuf) {
(key_path, config_path)
}
pub(crate) fn home(name: &String) -> std::path::PathBuf {
let mut path = dirs::home_dir().unwrap();
path.push(".side");
path.push(name);
path
}