Created
January 4, 2022 16:23
-
-
Save eduardonunesp/74638d5fa6934353f163e82595b890d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::{BufReader, BufRead, BufWriter, Write}; | |
use std::fs::File; | |
use std::prelude::*; | |
use std::io::{self, stdin, Read}; | |
let sin = io::stdin(); | |
let mut buf = String::new(); | |
let mut name: String = String::new(); | |
println!("Enter something"); | |
match sin.read_line(&mut buf) { | |
Ok(_) => { | |
name = buf.trim().to_string(); | |
buf.clear(); | |
}, | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment