From 63cfcbe7a7745b276de58ec92e0141b958c44feb Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Sat, 10 Aug 2024 19:06:46 +0200 Subject: use unsafe blocks instead of mutexes --- src/config/env.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/config/env.rs (limited to 'src/config/env.rs') 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 = 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 = 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(), + } +}); -- cgit v1.2.3-70-g09d2