Skip to content

Commit

Permalink
Use rank from api endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jgadelange authored Dec 18, 2024
1 parent 643b80a commit ec1f52c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ async fn leaderboard_today(ctx: Context<'_>) -> Result<(), Error> {
aoch_data
.today
.into_iter()
.enumerate()
.map(|i, x| {
.map(|x| {
let name: String = remove_emoji(&x.name.unwrap_or_else(|| ANON_USER.to_string()));

let mut stars: String = String::new();
Expand All @@ -151,7 +150,7 @@ async fn leaderboard_today(ctx: Context<'_>) -> Result<(), Error> {
"{2:>4}) | {name:0$} | {stars:<5} | {1:>5}",
start_width,
x.score,
i + 1
x.rank
)
})
.collect::<Vec<String>>()
Expand Down

0 comments on commit ec1f52c

Please sign in to comment.