diff options
| author | MaxVerevkin <maxxverrr@gmail.com> | 2022-12-10 17:46:48 +0200 |
|---|---|---|
| committer | MaxVerevkin <maxxverrr@gmail.com> | 2022-12-10 17:46:48 +0200 |
| commit | 2570f39b5daf6e2a13b3973d47aa7c67fbb457fb (patch) | |
| tree | e330dee89380a94635113c1312a9dcbb0d9e5883 /src/shared_state.rs | |
| parent | f6727acdd4cc112c51d3dd71df61689738e31de9 (diff) | |
| download | i3bar-mango-2570f39b5daf6e2a13b3973d47aa7c67fbb457fb.tar.gz | |
refactor
Diffstat (limited to 'src/shared_state.rs')
| -rw-r--r-- | src/shared_state.rs | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/shared_state.rs b/src/shared_state.rs index 554d856..c4ec9d6 100644 --- a/src/shared_state.rs +++ b/src/shared_state.rs @@ -1,7 +1,4 @@ -use smithay_client_toolkit::{ - reexports::client::QueueHandle, - shm::{slot::SlotPool, ShmState}, -}; +use smithay_client_toolkit::{reexports::client::QueueHandle, shm::slot::SlotPool}; use crate::{ config::Config, @@ -13,18 +10,9 @@ use crate::{ #[derive(Debug)] pub struct SharedState { pub qh: QueueHandle<State>, - pub shm_state: ShmState, - pub pool: Option<SlotPool>, + pub pool: SlotPool, pub config: Config, pub status_cmd: Option<StatusCmd>, pub blocks: Vec<Block>, pub blocks_cache: Vec<ComputedBlock>, } - -impl SharedState { - pub fn get_pool(&mut self, len: usize) -> &mut SlotPool { - self.pool.get_or_insert_with(|| { - SlotPool::new(len, &self.shm_state).expect("Failed to create pool") - }) - } -} |
