diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-14 23:00:15 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-15 12:45:54 -0500 |
commit | acd1173848b4db1c733af7d3f53d24aab900b542 (patch) | |
tree | b0a1151e390c6063169325bc4520d7b79ac50d9e /src/dirs.rs | |
parent | cc20037ff21a259419c7c00f6fce82ded3888d1e (diff) | |
download | rbw-acd1173848b4db1c733af7d3f53d24aab900b542.tar.gz rbw-acd1173848b4db1c733af7d3f53d24aab900b542.zip |
clippy
Diffstat (limited to 'src/dirs.rs')
-rw-r--r-- | src/dirs.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/dirs.rs b/src/dirs.rs index 285a0d5..bc97ed5 100644 --- a/src/dirs.rs +++ b/src/dirs.rs @@ -37,12 +37,14 @@ pub fn make_all() -> Result<()> { Ok(()) } +#[must_use] pub fn config_file() -> std::path::PathBuf { config_dir().join("config.json") } const INVALID_PATH: &percent_encoding::AsciiSet = &percent_encoding::CONTROLS.add(b'/').add(b'%').add(b':'); +#[must_use] pub fn db_file(server: &str, email: &str) -> std::path::PathBuf { let server = percent_encoding::percent_encode(server.as_bytes(), INVALID_PATH) @@ -50,37 +52,45 @@ pub fn db_file(server: &str, email: &str) -> std::path::PathBuf { cache_dir().join(format!("{}:{}.json", server, email)) } +#[must_use] pub fn pid_file() -> std::path::PathBuf { runtime_dir().join("pidfile") } +#[must_use] pub fn agent_stdout_file() -> std::path::PathBuf { data_dir().join("agent.out") } +#[must_use] pub fn agent_stderr_file() -> std::path::PathBuf { data_dir().join("agent.err") } +#[must_use] pub fn socket_file() -> std::path::PathBuf { runtime_dir().join("socket") } +#[must_use] fn config_dir() -> std::path::PathBuf { let project_dirs = directories::ProjectDirs::from("", "", "rbw").unwrap(); project_dirs.config_dir().to_path_buf() } +#[must_use] fn cache_dir() -> std::path::PathBuf { let project_dirs = directories::ProjectDirs::from("", "", "rbw").unwrap(); project_dirs.cache_dir().to_path_buf() } +#[must_use] fn data_dir() -> std::path::PathBuf { let project_dirs = directories::ProjectDirs::from("", "", "rbw").unwrap(); project_dirs.data_dir().to_path_buf() } +#[must_use] fn runtime_dir() -> std::path::PathBuf { let project_dirs = directories::ProjectDirs::from("", "", "rbw").unwrap(); match project_dirs.runtime_dir() { |