Show prompt on same line
This commit is contained in:
parent
285ff4c8c6
commit
dcef0a3943
|
@ -1,4 +1,5 @@
|
|||
use std::io;
|
||||
use std::io::Write;
|
||||
|
||||
pub fn do_math(arguments: String, operator: char) -> u32 {
|
||||
let split_args = arguments.split("-").collect::<Vec<&str>>();
|
||||
|
@ -38,7 +39,8 @@ pub fn args_or_comments(arguments: &str) -> String {
|
|||
}
|
||||
|
||||
pub fn read_stdin(prompt: &str) -> String {
|
||||
println!("{}", prompt);
|
||||
print!("{}", prompt);
|
||||
io::stdout().flush().unwrap();
|
||||
|
||||
let mut result = String::new();
|
||||
io::stdin().read_line(&mut result).expect("Expected a string!");
|
||||
|
|
Loading…
Reference in New Issue