Skip to content

Commit

Permalink
clean unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
Dixeran authored and wez committed Jan 17, 2022
1 parent 1bdc952 commit cf22db9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mux/src/tmux_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl TmuxDomainState {
active_lock: active_lock.clone(),
master_pane: ref_pane,
};
let writer = pane_pty.try_clone_writer().unwrap();
let writer = pane_pty.try_clone_writer()?;
let mux = Mux::get().expect("should be called at main thread");
let size = PtySize {
rows: pane.pane_height as u16,
Expand Down Expand Up @@ -278,8 +278,11 @@ impl TmuxCommand for CapturePane {

let pane_map = tmux_domain.inner.remote_panes.borrow();
if let Some(pane) = pane_map.get(&self.0) {
let lock = pane.lock().unwrap();
lock.tx.send(result.output.to_owned()).unwrap();
let lock = pane.lock().expect("Grant lock of tmux cmd queue failed");
return lock
.tx
.send(result.output.to_owned())
.map_err(|err| anyhow!("Send to tmux cmd queue failed {}", err));
}

Ok(())
Expand Down

0 comments on commit cf22db9

Please sign in to comment.