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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/// Reads a single line from the standard input.
///
/// The terminating `\n` character is preserved, but will be absent on end of input.
///
/// # Panics
///
/// This function panics if an error occurs whilst reading the standard input of the program.
///
/// # Examples
///
/// Reading a single line:
///
/// ```no_run
/// let line = ftkit::read_line();
/// println!("You just wrote: {}", line.trim());
/// ```
///
/// Reading lines until the End-Of-File:
///
/// ```no_run
/// loop {
/// let line = ftkit::read_line();
/// if line.is_empty() {
/// break;
/// }
/// println!("You just wrote: {}", line.trim());
/// }
/// ```
/// Reads a number from the standard input. The function loops indefinitely until a valid number is
/// provided. If the End-Of-File is reached, the function panics.
///
/// # Panics
///
/// This function panics if it fails to read from the standard input of the program.
///
/// # Examples
///
/// ```no_run
/// println!("How old are you?");
/// let age = ftkit::read_number();
/// println!("Oh? So you are {age} year(s) old?");
/// ```