summaryrefslogtreecommitdiffstats
path: root/src/ssh.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ssh.rs')
-rw-r--r--src/ssh.rs14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/ssh.rs b/src/ssh.rs
index 29c6de3..4acbe61 100644
--- a/src/ssh.rs
+++ b/src/ssh.rs
@@ -1,9 +1,7 @@
-use std::time::{SystemTime, UNIX_EPOCH};
-
use directories::UserDirs;
use ssh2::KnownHostFileKind;
-use crate::{Session, SessionSource, State};
+use crate::{Session, SessionSource};
impl SessionSource for ssh2::Session {
type Error = ssh2::Error;
@@ -11,10 +9,6 @@ impl SessionSource for ssh2::Session {
type Iter = Vec<Session>;
fn sessions(&self) -> Result<Self::Iter, Self::Error> {
- let timestamp = SystemTime::now()
- .duration_since(UNIX_EPOCH)
- .expect("Current time is pre-epoch. (Time traveler?)");
-
let mut known_hosts = self.known_hosts()?;
let file = UserDirs::new()
@@ -28,11 +22,7 @@ impl SessionSource for ssh2::Session {
.hosts()?
.into_iter()
.filter_map(|h| match h.name() {
- Some(name) => Some(Session {
- state: State::Discovered,
- timestamp,
- name: name.to_owned(),
- }),
+ Some(name) => Some(name.to_owned().into()),
None => {
tracing::warn!("Invalid host: No plain text host name exists");
None