summaryrefslogtreecommitdiff
path: root/src/status_cmd.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/status_cmd.rs')
-rw-r--r--src/status_cmd.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/status_cmd.rs b/src/status_cmd.rs
index 7cbdead..a229200 100644
--- a/src/status_cmd.rs
+++ b/src/status_cmd.rs
@@ -1,8 +1,6 @@
-use std::cell::RefCell;
use std::io::{BufRead, BufReader, Result, Write};
use std::os::unix::prelude::AsRawFd;
use std::process::{Child, ChildStdin, ChildStdout, Command, Stdio};
-use std::rc::Rc;
use smithay_client_toolkit::reexports::calloop::{self, LoopHandle};
@@ -64,7 +62,7 @@ impl StatusCmd {
Ok(())
}
- pub fn quick_insert(&self, handle: LoopHandle<()>, bar_state: Rc<RefCell<BarState>>) {
+ pub fn quick_insert(&self, handle: LoopHandle<BarState>) {
handle
.insert_source(
calloop::generic::Generic::new(
@@ -75,12 +73,11 @@ impl StatusCmd {
},
calloop::Mode::Level,
),
- move |ready, _, _| {
+ move |ready, _, bar_state| {
if ready.readable {
- bar_state.borrow_mut().notify_available()?;
+ bar_state.notify_available()?;
Ok(calloop::PostAction::Continue)
} else {
- let mut bar_state = bar_state.borrow_mut();
bar_state.set_error("error reading from status command");
if let Some(mut child) = bar_state.status_cmd.take() {
let _ = child.child.kill();