Skip to content

Commit 35a9402

Browse files
committed
fix : add an entry input to leave the program
Ajout d'un pause et d'une attente d'input utilisateur pour fermer le programme a la fin
1 parent f8a373d commit 35a9402

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pokedex"
3-
version = "0.1.0"
3+
version = "0.0.2"
44
edition = "2024"
55

66
[dependencies]

src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use colored::*;
22
use std::collections::{HashMap, HashSet};
3-
use std::io::{self};
3+
use std::io::{self, Write};
44
mod gen1;
55

66
type Pokedex = HashMap<String, HashSet<String>>;
@@ -145,4 +145,8 @@ fn main() {
145145
} else {
146146
println!("Affichage du Pokédex annulé.");
147147
}
148+
149+
println!("\nAppuyez sur Entrée pour quitter...");
150+
io::stdout().flush().unwrap(); // s'assurer que le texte s'affiche avant de bloquer
151+
let _ = io::stdin().read_line(&mut String::new());
148152
}

0 commit comments

Comments
 (0)