Skip to content

Commit 878ba84

Browse files
committed
fix: improve look of score and top command.
1 parent 546170a commit 878ba84

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/commands/score.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct UserInfo {
1212

1313
impl Display for UserInfo {
1414
fn fmt(&self, f: &mut Formatter) -> fmtResult {
15-
writeln!(f, " - {} > {}", self.user_name, self.score)
15+
writeln!(f, "**{}** — **{}** ", self.user_name, self.score)
1616
}
1717
}
1818

@@ -38,10 +38,9 @@ Returns the Top Scoring User.
3838
pub async fn top(ctx: Context<'_>) -> Result<(), Error> {
3939
let top_scores = get_top_scores(1).await;
4040

41-
let mut reply_string: String = String::new();
41+
let mut reply_string = String::new();
4242
for (i, value) in top_scores.0.iter().enumerate() {
43-
reply_string.push_str((i + 1).to_string().as_str());
44-
reply_string.push_str(value.to_string().as_str());
43+
reply_string.push_str(&format!("{}. {}", i + 1, value));
4544
}
4645

4746
if let Err(why) = ctx.reply(reply_string).await {
@@ -66,7 +65,7 @@ pub async fn leader(ctx: Context<'_>) -> Result<(), Error> {
6665
_ => "🔹",
6766
};
6867
reply_string.push_str(&format!(
69-
"{} **#{}** — {} — **{}** points\n",
68+
"{} **#{}** — {} — **{}** \n",
7069
place,
7170
i + 1,
7271
value.user_name,

0 commit comments

Comments
 (0)