karma: leaderboard + rank, drop code-noise targets, atomic store writes
All checks were successful
ci / check (push) Successful in 48s

This commit is contained in:
Jean Chevronnet 2026-07-29 20:44:26 +00:00
parent 21e36b9961
commit af9d5eed25
No known key found for this signature in database
GPG key ID: 439666D63A9477E4
5 changed files with 159 additions and 16 deletions

View file

@ -132,7 +132,12 @@ impl Store {
}
fn save(&self, path: &Path) -> io::Result<()> {
fs::write(path, to_json(&self.map) + "\n")
let body = to_json(&self.map) + "\n";
let mut tmp = path.to_path_buf().into_os_string();
tmp.push(".tmp");
let tmp = PathBuf::from(tmp);
fs::write(&tmp, body)?;
fs::rename(&tmp, path)
}
fn get(&self, nick: &str) -> Option<&String> {