From 9c3185ccc2500bb6b76a781f89514f2aab19d1da Mon Sep 17 00:00:00 2001 From: tbergerd <139167029+tbergerd@users.noreply.github.com> Date: Sun, 10 Sep 2023 20:12:21 +0200 Subject: [PATCH] Remove dead code and unnecessary 'Debug' trait bound on Input's 'interact_text*' methods --- src/prompts/input.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/prompts/input.rs b/src/prompts/input.rs index 510aecf..209ff68 100644 --- a/src/prompts/input.rs +++ b/src/prompts/input.rs @@ -1,6 +1,5 @@ use std::{ cmp::Ordering, - fmt::Debug, io, iter, str::FromStr, sync::{Arc, Mutex}, @@ -281,7 +280,7 @@ where impl Input<'_, T> where T: Clone + ToString + FromStr, - ::Err: Debug + ToString, + ::Err: ToString, { /// Enables the user to enter a printable ascii sequence and returns the result. /// @@ -313,11 +312,6 @@ where }, )?; - // Read input by keystroke so that we can suppress ascii control characters - if !term.features().is_attended() { - return Ok("".to_owned().parse::().unwrap()); - } - let mut chars: Vec = Vec::new(); let mut position = 0; #[cfg(feature = "history")] @@ -629,13 +623,7 @@ where } } } -} -impl Input<'_, T> -where - T: Clone + ToString + FromStr, - ::Err: ToString, -{ /// Enables user interaction and returns the result. /// /// Allows any characters as input, including e.g arrow keys.