text-input 0.1.2

A simple library for interactive text input in the terminal
Documentation
1
2
3
4
5
6
7
8
9
use std::io::{self, Write};

pub fn text(texto: &str) -> String{
    print!("{}",texto);
    io::stdout().flush().unwrap();
    let mut x = String::new();
    io::stdin().read_line(&mut x).unwrap();
    x.trim().to_string()
}