INNER CODE UNIT · Rust

read_user_input

xajik/thedeck · scripts/thedeck-helper/src/main.rs:59

fn read_user_input(prompt: &str) -> Result<String, io::Error> {
    print!("{}", prompt);
    io::stdout().flush()?;

    let mut input = String::new();
    io::stdin().read_line(&mut input)?;

    Ok(input.trim().to_owned())
}

// Create functions

fn create_new_view_model(
    folder: &str,
    file_prefix: &str,
    class_prefix: &str,
) -> Result<(), Box<dyn std::error::Error>> {
    let folder = format!("./lib/ui/screens/{}", folder.trim());

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…