Skip to content
This repository has been archived by the owner on Dec 22, 2024. It is now read-only.

Commit

Permalink
No need to store in variable first, directly hand it to writeln
Browse files Browse the repository at this point in the history
  • Loading branch information
Ganneff committed Oct 3, 2024
1 parent e5f4813 commit d250f61
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1146,11 +1146,11 @@ lazy_static! {
/// Simply runs `tmux list-sessions`
#[tracing::instrument(level = "trace", skip(handle), ret, err)]
fn ls<W: Write>(handle: &mut BufWriter<W>) -> Result<()> {
let sessions = Tmux::with_command(ListSessions::new())
.output()?
.to_string();
writeln!(handle, "{sessions}")?;
Ok(())
Ok(writeln!(
handle,
"{}",
Tmux::with_command(ListSessions::new()).output()?
)?)
}

/// Tiny helper to replace the magic ++TMREPLACETM++
Expand Down

0 comments on commit d250f61

Please sign in to comment.