From 319c38cc2bad5d1e80f0f240477fa699854fdcb9 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Tue, 11 Feb 2020 20:00:46 -0500 Subject: [PATCH] Fix a bug where Contest is never fetched with problems --- youmubot-cf/src/hook.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/youmubot-cf/src/hook.rs b/youmubot-cf/src/hook.rs index 2a345d8..1affa61 100644 --- a/youmubot-cf/src/hook.rs +++ b/youmubot-cf/src/hook.rs @@ -45,11 +45,10 @@ impl ContestCache { Some((c, None)) => match Contest::standings(http, contest_id, |f| f.limit(1, 1)) { Ok((c, p, _)) => Ok({ drop(rl); - self.0 - .write() - .entry(contest_id) - .or_insert((c, Some(p))) - .clone() + let mut v = self.0.write(); + let v = v.entry(contest_id).or_insert((c, None)); + v.1 = Some(p); + v.clone() }), Err(_) => Ok((c.clone(), None)), },