From 748d65cbfea00afbb26037a710cb93fe0cea0e4e Mon Sep 17 00:00:00 2001 From: soup Date: Sat, 12 Apr 2025 00:05:08 -0400 Subject: [PATCH] [porthole] clean up warnings --- porthole/src/main.rs | 2 +- porthole/src/utils.rs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/porthole/src/main.rs b/porthole/src/main.rs index f9b9257..59deeb9 100644 --- a/porthole/src/main.rs +++ b/porthole/src/main.rs @@ -10,7 +10,7 @@ fn main() { &["configure", "server"] => server::configure(), &["configure", "client"] => (), &["start", "server"] => (), - &["start", "client", local_port] => (), + &["start", "client", _local_port] => (), _ => { println!("porthole "); }, diff --git a/porthole/src/utils.rs b/porthole/src/utils.rs index ee63825..d2a0702 100644 --- a/porthole/src/utils.rs +++ b/porthole/src/utils.rs @@ -6,9 +6,7 @@ pub fn get_config_file_path(name: &str) -> IoResult { } pub fn read_password(prompt: &str) -> IoResult { - let mut stdin = std::io::stdin().lock(); - - let mut password = rpassword::prompt_password(prompt)?; + let password = rpassword::prompt_password(prompt)?; Ok(password) } @@ -34,7 +32,7 @@ where loop { print!("{}", prompt); - std::io::stdout().flush(); + std::io::stdout().flush()?; let mut s = String::new(); stdin.read_line(&mut s)?; let parsed = match s.trim().parse() {