pub async fn game_list(&mut self, from: usize) -> RedisResult<Vec<GameSummary>> {
debug!("game_list(from: {})", from);
let games: Vec<u32> = self.redis.lrange("game:list", from as isize, -1).await?;
- let mut summaries = Vec::new();
+ let mut summaries = Vec::with_capacity(games.len());
for id in games {
- summaries.push(self.game_summary(id).await?);
+ match self.game_summary(id).await {
+ Ok(summary) => summaries.push(summary),
+ Err(err) => error!("Could not find summary for game {}", id),
+ }
}
Ok(summaries)
}