Skip to content

Commit

Permalink
Merge pull request #280 from tbergerd/dev
Browse files Browse the repository at this point in the history
Remove dead code and  'Debug' trait bound on Input's 'interact_text*' methods
  • Loading branch information
pksunkara committed Sep 13, 2023
2 parents ac365d8 + 9c3185c commit 7aa4afa
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/prompts/input.rs
@@ -1,6 +1,5 @@
use std::{
cmp::Ordering,
fmt::Debug,
io, iter,
str::FromStr,
sync::{Arc, Mutex},
Expand Down Expand Up @@ -281,7 +280,7 @@ where
impl<T> Input<'_, T>
where
T: Clone + ToString + FromStr,
<T as FromStr>::Err: Debug + ToString,
<T as FromStr>::Err: ToString,
{
/// Enables the user to enter a printable ascii sequence and returns the result.
///
Expand Down Expand Up @@ -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::<T>().unwrap());
}

let mut chars: Vec<char> = Vec::new();
let mut position = 0;
#[cfg(feature = "history")]
Expand Down Expand Up @@ -629,13 +623,7 @@ where
}
}
}
}

impl<T> Input<'_, T>
where
T: Clone + ToString + FromStr,
<T as FromStr>::Err: ToString,
{
/// Enables user interaction and returns the result.
///
/// Allows any characters as input, including e.g arrow keys.
Expand Down

0 comments on commit 7aa4afa

Please sign in to comment.