summaryrefslogtreecommitdiffstats
path: root/src/tmux.rs
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2023-04-04 14:02:45 -0500
committerToby Vincent <tobyv13@gmail.com>2023-04-04 14:03:42 -0500
commit69733a88613394715b6409a98bca34d41e7dba70 (patch)
tree10c279276bb7d96c1eab9b4d0348e56a16190e21 /src/tmux.rs
parent10a035834bbb6abc7fe663d0345498720f5d625b (diff)
refactor: clean up tmux error handling and remove unused module
Diffstat (limited to 'src/tmux.rs')
-rw-r--r--src/tmux.rs16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/tmux.rs b/src/tmux.rs
index e1fa3a6..e3efbd5 100644
--- a/src/tmux.rs
+++ b/src/tmux.rs
@@ -28,18 +28,11 @@ impl Tmux {
.output()?
.stdout;
- let sessions: Vec<Session> = std::str::from_utf8(&stdout)?
+ std::str::from_utf8(&stdout)?
.lines()
- .filter_map(|s| match ron::from_str(s) {
- Ok(session) => Some(session),
- Err(err) => {
- tracing::warn!(%err, "Invalid session format");
- None
- }
- })
- .collect();
-
- Ok(sessions)
+ .map(ron::from_str)
+ .collect::<Result<_, _>>()
+ .map_err(Into::into)
}
}
@@ -50,6 +43,7 @@ mod tests {
const SOCKET: &str = "test";
#[test]
+ #[ignore]
fn test_tmux_list() -> Result<(), Error> {
let names = Vec::from(["test_1", "test_2", "test_3", "test_4"]);