Skip to content

Commit

Permalink
fix: Proper display of stars for 2022 Day 25
Browse files Browse the repository at this point in the history
  • Loading branch information
WillLillis committed Nov 19, 2023
1 parent 8192ad5 commit 3becde5
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions aoc-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,12 @@ impl AocClient {
))
.unwrap();

let all_stars = if main.contains("calendar calendar-perfect") {
true
} else {
false
};

// Remove stars that have not been collected
let calendar = cleaned_up
.lines()
Expand All @@ -394,13 +400,14 @@ impl AocClient {
.map(|c| c.as_str())
.unwrap_or("");

let stars = if class.contains("calendar-verycomplete") {
"**"
} else if class.contains("calendar-complete") {
"*"
} else {
""
};
let stars =
if class.contains("calendar-verycomplete") || all_stars {
"**"
} else if class.contains("calendar-complete") {
"*"
} else {
""
};

star_regex.replace(line, stars)
})
Expand Down

0 comments on commit 3becde5

Please sign in to comment.