Skip to content

Instantly share code, notes, and snippets.

@eduardonunesp
Created January 4, 2022 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eduardonunesp/74638d5fa6934353f163e82595b890d7 to your computer and use it in GitHub Desktop.
Save eduardonunesp/74638d5fa6934353f163e82595b890d7 to your computer and use it in GitHub Desktop.
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