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)) { Some((c, None)) => match Contest::standings(http, contest_id, |f| f.limit(1, 1)) {
Ok((c, p, _)) => Ok({ Ok((c, p, _)) => Ok({
drop(rl); drop(rl);
self.0 let mut v = self.0.write();
.write() let v = v.entry(contest_id).or_insert((c, None));
.entry(contest_id) v.1 = Some(p);
.or_insert((c, Some(p))) v.clone()
.clone()
}), }),
Err(_) => Ok((c.clone(), None)), Err(_) => Ok((c.clone(), None)),
}, },