From 2570f39b5daf6e2a13b3973d47aa7c67fbb457fb Mon Sep 17 00:00:00 2001 From: MaxVerevkin Date: Sat, 10 Dec 2022 17:46:48 +0200 Subject: refactor --- src/shared_state.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/shared_state.rs') 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, - pub shm_state: ShmState, - pub pool: Option, + pub pool: SlotPool, pub config: Config, pub status_cmd: Option, pub blocks: Vec, pub blocks_cache: Vec, } - -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") - }) - } -} -- cgit v1.3.1