1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! # ask_input — Simple data input in Rust
//!
//! This library makes terminal input in Rust as easy and convenient as it is in Python.
//! One single generic function to handle all your input needs with automatic stdout flushing.
//!
//! ## Quick Start
//! ```
//! use ask_input::input;
//!
//! let age: i32 = input().unwrap();
//! println!("You are {} years old", age);
//!
//! let name: String = input().unwrap();
//! println!("Hello, {}!", name);
//! ```
use ;
use FromStr;
/// Reads a line from stdin, flushes stdout automatically, and parses it into the target type.
///
/// The target type is inferred automatically based on the variable type assignment.
///
/// # Examples
/// ```
/// let age: i32 = ask_input::input().unwrap();
/// println!("Age: {}", age);
///
/// let name: String = ask_input::input().unwrap();
/// println!("Hello, {}!", name);
///
/// let price: f64 = ask_input::input().unwrap();
/// println!("Price: \${}", price);
/// ```