Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead code and 'Debug' trait bound on Input's 'interact_text*' methods #280

Merged
merged 1 commit into from Sep 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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