diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-10 19:06:46 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-10 19:06:46 +0200 |
| commit | 63cfcbe7a7745b276de58ec92e0141b958c44feb (patch) | |
| tree | 990e33a83756e27187033579ee2f85d5c79169d5 /src/config/env.rs | |
| parent | b747ca8af52129876b577a4f20f7105a05c6b002 (diff) | |
use unsafe blocks instead of mutexes
Diffstat (limited to 'src/config/env.rs')
| -rw-r--r-- | src/config/env.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/config/env.rs b/src/config/env.rs new file mode 100644 index 0000000..5d53cc5 --- /dev/null +++ b/src/config/env.rs @@ -0,0 +1,22 @@ +use once_cell::sync::Lazy; + +pub static USER_CONFIG_DIR: Lazy<String> = Lazy::new(|| { + match dirs::config_local_dir() { + Some(mut d) => { + d.push("neosheet"); + d.as_path().to_str().unwrap_or("").to_string() + } + None => String::new(), + } +}); + +pub static USER_RC_PATH: Lazy<String> = Lazy::new(|| { + match dirs::config_local_dir() { + Some(mut d) => { + d.push("neosheet"); + d.push("init.lua"); + d.as_path().to_str().unwrap_or("").to_string() + } + None => String::new(), + } +}); |