From bc18bca5c67b4a678a31198877e39d57d97b1e0c Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 6 Apr 2020 06:35:30 -0400 Subject: factor out into an agent --- src/dirs.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/dirs.rs (limited to 'src/dirs.rs') 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() +} -- cgit v1.2.3-54-g00ecf