rlibutils 0.1.0

A small collection of utility functions for your rust projects
Documentation
1
2
3
4
5
6
7
8
9
10
11
use std::io::{self, Write};

pub fn read_from_input(message: &str) -> Result<String, anyhow::Error> {
    let mut result_string = String::new();
    print!("{}: ", message);
    io::stdout().flush()?;

    io::stdin().read_line(&mut result_string)?;
    let result_string = result_string.trim();
    Ok(result_string.to_string())
}