summaryrefslogtreecommitdiff
path: root/src/status_cmd.rs
diff options
context:
space:
mode:
authorMax Verevkin <maxxverrr@gmail.com>2022-07-18 23:55:16 +0300
committerMax Verevkin <maxxverrr@gmail.com>2022-07-18 23:55:16 +0300
commit6d2a9b349470f905025c0a6be027a8ba8227b972 (patch)
treed0093cfdde18142dcb9238b15e4eb849bd5cd76b /src/status_cmd.rs
parentaa8c17a178aa2478230d3172cba8bfe03ea7333d (diff)
downloadi3bar-mango-6d2a9b349470f905025c0a6be027a8ba8227b972.tar.gz
refactor
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();