diff options
| author | Kunal Mohan <kunalmohan99@gmail.com> | 2021-05-03 17:23:32 +0530 |
|---|---|---|
| committer | Kunal Mohan <kunalmohan99@gmail.com> | 2021-05-04 20:48:17 +0530 |
| commit | ea552d71e4b1d4a72d30f4481079cb0e30b0fc58 (patch) | |
| tree | d557367d1b170e0ce517dc8effd1175783cb6fd1 /src/common/mod.rs | |
| parent | use better names for senders, receivers and threads (diff) | |
| download | sl0ppij-ea552d71e4b1d4a72d30f4481079cb0e30b0fc58.tar.gz sl0ppij-ea552d71e4b1d4a72d30f4481079cb0e30b0fc58.tar.xz sl0ppij-ea552d71e4b1d4a72d30f4481079cb0e30b0fc58.zip | |
Introduce IpcReceiverWIthContext and move ipc stuff to common/ipc.rs
Fall back to /tmp/zellij-{uid} directory if runtime_dir is not available.
Use serialize_into() to avoid Vec allocation.
And some cleanup
Diffstat (limited to 'src/common/mod.rs')
| -rw-r--r-- | src/common/mod.rs | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/common/mod.rs b/src/common/mod.rs index bf4c3ae6..6061f1a6 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -12,11 +12,8 @@ pub mod wasm_vm; use crate::panes::PaneId; use crate::server::ServerInstruction; use async_std::task_local; -use directories_next::ProjectDirs; use errors::{get_current_ctx, ErrorContext}; -use lazy_static::lazy_static; use std::cell::RefCell; -use std::path::PathBuf; use std::sync::mpsc; /// An [MPSC](mpsc) asynchronous channel with added error context. @@ -76,15 +73,3 @@ task_local! { /// stack in the form of an [`ErrorContext`]. static ASYNCOPENCALLS: RefCell<ErrorContext> = RefCell::default() } - -lazy_static! { - pub static ref ZELLIJ_IPC_PIPE: PathBuf = { - let project_dir = ProjectDirs::from("org", "Zellij Contributors", "Zellij").unwrap(); - let ipc_dir = project_dir - .runtime_dir() - .unwrap_or_else(|| project_dir.cache_dir()); - std::fs::create_dir_all(ipc_dir).unwrap(); - let session_name = names::Generator::default().next().unwrap(); - ipc_dir.join(session_name) - }; -} |
