Skip to content
Snippets Groups Projects
Commit a27bc1bf authored by Henrik Tjäder's avatar Henrik Tjäder
Browse files

Ran cargo fmt

parent 16b76d6e
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,6 @@ fn main() {
println!("The secret number is: {}", secret_number);
loop {
// Get the value from inside the Ok, else print the error
let guess = match get_input() {
Ok(num) => num,
......@@ -44,20 +43,20 @@ fn main() {
for x in attempt_history {
println!("{:?}", x);
}
println!("Since the HashMap does not push things onto a heap like
the Vec-type does, it will iterate over and print in the order items are found");
println!(
"Since the HashMap does not push things onto a heap like
the Vec-type does, it will iterate over and print in the order items are found"
);
break;
}
}
println!("Attempts so far: {}\n ", tries_counter);
}
}
fn get_input() -> Result<u32, String> {
let mut text_input = String::new();
println!("Please input your guess.");
......@@ -66,8 +65,7 @@ fn get_input() -> Result<u32, String> {
Instead of using the expect,
save and return potential error
*/
let input = io::stdin()
.read_line(&mut text_input);
let input = io::stdin().read_line(&mut text_input);
match input {
Ok(_) => (),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment