diff options
author | Jesse Luehrs <doy@tozt.net> | 2020-04-06 06:35:30 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2020-04-06 06:35:30 -0400 |
commit | bc18bca5c67b4a678a31198877e39d57d97b1e0c (patch) | |
tree | 3dc31608586cbe0f7973d7aa730267d57224e6a1 /src/dirs.rs | |
parent | 4ad2f0a0dc3abb4cb10a6b82ca6a1f3a829eb1fb (diff) | |
download | rbw-bc18bca5c67b4a678a31198877e39d57d97b1e0c.tar.gz rbw-bc18bca5c67b4a678a31198877e39d57d97b1e0c.zip |
factor out into an agent
Diffstat (limited to 'src/dirs.rs')
-rw-r--r-- | src/dirs.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/dirs.rs b/src/dirs.rs new file mode 100644 index 0000000..177ea58 --- /dev/null +++ b/src/dirs.rs @@ -0,0 +1,14 @@ +pub fn config_dir() -> std::path::PathBuf { + let project_dirs = directories::ProjectDirs::from("", "", "rbw").unwrap(); + project_dirs.config_dir().to_path_buf() +} + +pub fn cache_dir() -> std::path::PathBuf { + let project_dirs = directories::ProjectDirs::from("", "", "rbw").unwrap(); + project_dirs.cache_dir().to_path_buf() +} + +pub fn runtime_dir() -> std::path::PathBuf { + let project_dirs = directories::ProjectDirs::from("", "", "rbw").unwrap(); + project_dirs.runtime_dir().unwrap().to_path_buf() +} |