diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/history/error.rs | 14 | ||||
-rw-r--r-- | src/tmux.rs | 16 |
2 files changed, 5 insertions, 25 deletions
diff --git a/src/history/error.rs b/src/history/error.rs deleted file mode 100644 index 8bdd2d6..0000000 --- a/src/history/error.rs +++ /dev/null @@ -1,14 +0,0 @@ -#[derive(Debug, thiserror::Error)] -pub enum Error { - #[error("IO error: {0}")] - IO(#[from] std::io::Error), - - #[error(transparent)] - Serialize(#[from] ron::Error), - - #[error(transparent)] - Format(#[from] ron::de::SpannedError), - - #[error(transparent)] - Tmux(#[from] crate::tmux::Error), -} 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"]); |