Skip to content

Commit

Permalink
Run cargo clippy --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
praseodym committed Dec 20, 2024
1 parent b83a71d commit 0632aeb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ fn truncate(s: &str, max_chars: usize) -> &str {
}

async fn get_leaderboard_data() -> AochData {
let response_data = reqwest::get("https://aoch.wisv.ch/data")

reqwest::get("https://aoch.wisv.ch/data")
.await
.unwrap()
.json()
.await
.unwrap();
response_data
.unwrap()
}

/// Displays the overall leaderboard of this year
Expand Down Expand Up @@ -100,7 +100,7 @@ async fn leaderboard_total(ctx: Context<'_>) -> Result<(), Error> {
);

let mut stylized_answer = table_rows[0..cmp::min(row_count, table_rows.len())].join("\n");
stylized_answer = format!("```\n{}```", truncate(&*stylized_answer, 1990));
stylized_answer = format!("```\n{}```", truncate(&stylized_answer, 1990));

ctx.say(stylized_answer).await?;
Ok(())
Expand Down Expand Up @@ -157,7 +157,7 @@ async fn leaderboard_today(ctx: Context<'_>) -> Result<(), Error> {
);

let mut stylized_answer = table_rows[0..cmp::min(row_count, table_rows.len())].join("\n");
stylized_answer = format!("```\n{}```", truncate(&*stylized_answer, 1990));
stylized_answer = format!("```\n{}```", truncate(&stylized_answer, 1990));
println!("{}", stylized_answer);
ctx.say(stylized_answer).await?;
Ok(())
Expand Down

0 comments on commit 0632aeb

Please sign in to comment.