diff --git a/src/main.rs b/src/main.rs index 926461d..55eeaf4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -38,7 +38,9 @@ lazy_static! { } pub async fn get_queue(guild_id: &GuildId) -> MusicQueue { - match HASHMAP.lock().await.get(&guild_id) { + let mut queues = HASHMAP.lock().await; + + match queues.get(&guild_id) { Some(music_queue) => music_queue.clone(), None => { let q = MusicQueue { @@ -46,7 +48,7 @@ pub async fn get_queue(guild_id: &GuildId) -> MusicQueue { queue: Vec::new(), now_playing: None, }; - HASHMAP.lock().await.insert(*guild_id, q.clone()); + queues.insert(*guild_id, q.clone()); q } }