diff --git a/src/main.rs b/src/main.rs index 57c8218..d18f612 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,17 +40,16 @@ fn main() { let guild_list = wynncraft::guild_list().unwrap(); let conn = establish_connection(); - let values = guild_list.into_iter().map(|name| { + guild_list.into_iter().for_each(|name| { thread::sleep_ms(2500); - Guild { prefix: wynncraft::guild(&name).unwrap().unwrap().prefix, name } - }).collect::>(); - for value in values.into_iter() { + println!("Getting {:?}", name); + let guild = Guild { prefix: wynncraft::guild(&name).unwrap().unwrap().prefix, name }; diesel::insert_into(guilds::table) - .values(&value) + .values(&guild) .on_conflict(guilds::prefix) .do_nothing() .execute(&conn).unwrap(); - } + }); println!("Guilds updated!");