diff --git a/src/commands.rs b/src/commands.rs index e8376e4..0026ff2 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1,5 +1,5 @@ pub mod interactive { - use std::path::{Path, PathBuf}; + use std::path::Path; use anyhow::Context; diff --git a/src/main.rs b/src/main.rs index 8da6ae9..255fc47 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,8 +5,7 @@ use clap::Parser; use tracing_subscriber::EnvFilter; use crate::{ - commands::interactive::InteractiveCommand, ssh_command::SshCommandState, - ssh_config::SshConfigServiceState, state::State, user_fuzzy_find::UserFuzzyFindState, + commands::interactive::InteractiveCommand, ssh_command::SshCommandState, state::State, }; mod commands; @@ -83,7 +82,5 @@ async fn main() -> anyhow::Result<()> { } } - return Ok(()); - Ok(()) } diff --git a/src/ssh_command.rs b/src/ssh_command.rs index 7f72183..b1828fb 100644 --- a/src/ssh_command.rs +++ b/src/ssh_command.rs @@ -1,5 +1,3 @@ -use std::process::Stdio; - use anyhow::Context; use crate::{ssh_config::SshItem, state::State}; diff --git a/src/ssh_config.rs b/src/ssh_config.rs index 424232c..3a2164e 100644 --- a/src/ssh_config.rs +++ b/src/ssh_config.rs @@ -70,7 +70,7 @@ impl SshItems { self.items.values().collect() } - pub fn from_choice(&self, choice: &str) -> Option<&SshItem> { + pub fn get_choice(&self, choice: &str) -> Option<&SshItem> { self.items.get(choice) } } diff --git a/src/state.rs b/src/state.rs index d214087..8ec5e87 100644 --- a/src/state.rs +++ b/src/state.rs @@ -1,4 +1,4 @@ -#[derive(Clone)] +#[derive(Clone, Default)] pub struct State {} impl State { diff --git a/src/user_fuzzy_find.rs b/src/user_fuzzy_find.rs index 0f1fb8c..bd5a991 100644 --- a/src/user_fuzzy_find.rs +++ b/src/user_fuzzy_find.rs @@ -36,7 +36,7 @@ impl UserFuzzyFind { let output = chosen_item.output(); let chosen_ssh_item = items - .from_choice(&output) // Cow, str, String + .get_choice(&output) // Cow, str, String .expect("always find an ssh item from a choice"); tracing::debug!("the user chose item: {chosen_ssh_item:#?}");