Python input function rewritten in rust

⚓ Rust    📅 2025-09-14    👤 surdeus    👁️ 12      

surdeus

Warning

This post was published 128 days ago. The information described in this article may have changed.

I saw this, and i decided to recreate it without looking at source code. I started rust today because i wanted to learn lower level languages unlike my python, lua, html css and javascript knowledge.

pub fn input(string:&str)->String{
    println!("{}",string);
    let mut line:String=String::new();
    line.clear();
    std::io::stdin()
        .read_line(&mut line).unwrap();
    return line;
}

1 post - 1 participant

Read full topic

🏷️ Rust_feed