File tree Expand file tree Collapse file tree 3 files changed +20
-17
lines changed
Expand file tree Collapse file tree 3 files changed +20
-17
lines changed Original file line number Diff line number Diff line change 1- use crate :: Pokemon ;
1+ use crate :: pokemon :: Pokemon ;
22
33pub fn gen1_pokedex ( ) -> Vec < Pokemon > {
44 vec ! [
Original file line number Diff line number Diff line change 11use colored:: * ;
22use std:: collections:: { HashMap , HashSet } ;
33use std:: io:: { self , Write } ;
4- mod gen1;
4+
5+ pub mod gen1;
6+ pub mod pokemon;
7+
8+ pub use crate :: pokemon:: Pokemon ;
59
610type Pokedex = HashMap < String , HashSet < String > > ;
711
@@ -89,21 +93,6 @@ fn add_pokemon_from_input(dex: &mut Pokedex) {
8993 add_pokemon ( dex, & p_type, & nom) ;
9094}
9195
92- #[ derive( Debug ) ]
93- struct Pokemon {
94- nom : String ,
95- p_type : String ,
96- }
97-
98- impl Pokemon {
99- fn new ( nom : & str , p_type : & str ) -> Self {
100- Self {
101- nom : nom. to_string ( ) ,
102- p_type : p_type. to_string ( ) ,
103- }
104- }
105- }
106-
10796fn main ( ) {
10897 println ! ( "initialisation du pokedex..." ) ;
10998 let mut dex = init_pokedex ( ) ;
Original file line number Diff line number Diff line change 1+ #[ derive( Debug ) ]
2+ pub struct Pokemon {
3+ pub nom : String ,
4+ pub p_type : String ,
5+ }
6+
7+ impl Pokemon {
8+ pub fn new ( nom : & str , p_type : & str ) -> Self {
9+ Self {
10+ nom : nom. to_string ( ) ,
11+ p_type : p_type. to_string ( ) ,
12+ }
13+ }
14+ }
You can’t perform that action at this time.
0 commit comments