Fix a bug where Contest is never fetched with problems

This commit is contained in:
Natsu Kagami 2020-02-11 20:00:46 -05:00
parent 5d6e537ac2
commit 319c38cc2b
Signed by: nki
GPG key ID: 73376E117CD20735

View file

@ -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)),
},