Skip to content

Commit 7aa4afa

Browse files
authored
Merge pull request console-rs#280 from tbergerd/dev
Remove dead code and 'Debug' trait bound on Input's 'interact_text*' methods
2 parents ac365d8 + 9c3185c commit 7aa4afa

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

src/prompts/input.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::{
22
cmp::Ordering,
3-
fmt::Debug,
43
io, iter,
54
str::FromStr,
65
sync::{Arc, Mutex},
@@ -281,7 +280,7 @@ where
281280
impl<T> Input<'_, T>
282281
where
283282
T: Clone + ToString + FromStr,
284-
<T as FromStr>::Err: Debug + ToString,
283+
<T as FromStr>::Err: ToString,
285284
{
286285
/// Enables the user to enter a printable ascii sequence and returns the result.
287286
///
@@ -313,11 +312,6 @@ where
313312
},
314313
)?;
315314

316-
// Read input by keystroke so that we can suppress ascii control characters
317-
if !term.features().is_attended() {
318-
return Ok("".to_owned().parse::<T>().unwrap());
319-
}
320-
321315
let mut chars: Vec<char> = Vec::new();
322316
let mut position = 0;
323317
#[cfg(feature = "history")]
@@ -629,13 +623,7 @@ where
629623
}
630624
}
631625
}
632-
}
633626

634-
impl<T> Input<'_, T>
635-
where
636-
T: Clone + ToString + FromStr,
637-
<T as FromStr>::Err: ToString,
638-
{
639627
/// Enables user interaction and returns the result.
640628
///
641629
/// Allows any characters as input, including e.g arrow keys.

0 commit comments

Comments
 (0)