Skip to content

Commit

Permalink
Avoid rewriting cache without changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zr40 authored and nuxeh committed Dec 1, 2024
1 parent 4af313b commit e333fac
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ impl Aoc {
let brief = http::get_brief(self)?;
self.title = Some(brief.0);
self.brief.insert(self.level, brief.1);
self.write()?;
};
self.write()?;
Ok(self.brief.get(&self.level).unwrap().to_string())
}

Expand Down Expand Up @@ -191,10 +191,9 @@ impl Aoc {
if self.input.is_none() || force {
let input = http::get_input(self)?;
self.input = Some(input);
self.write()?;
}

self.write()?;

Ok(self.input.clone().unwrap())
}

Expand All @@ -207,8 +206,8 @@ impl Aoc {
self.get_brief(true).ok(); // Update brief (force) to update stars
self.add_star();
self.advance().unwrap_or(());
self.write()?;
}
self.write()?;
Ok(resp)
}

Expand Down

0 comments on commit e333fac

Please sign in to comment.