From 0aa3c35879cc47e4ca511a5d160c65cdfbd407a9 Mon Sep 17 00:00:00 2001 From: washbin <76929116+washbin@users.noreply.github.com> Date: Wed, 12 Oct 2022 21:40:48 +0545 Subject: [PATCH] chore: make clippy happy --- src/commands/hero.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/commands/hero.rs b/src/commands/hero.rs index 81b1e9f..6848179 100644 --- a/src/commands/hero.rs +++ b/src/commands/hero.rs @@ -42,17 +42,15 @@ pub async fn run(ctx: Context, command: ApplicationCommandInteraction, hero: Her pull_req_cloned += &format!("<:reply:1029065416905076808>[{}]({})\n", pr.title, pr.url); } else { - pull_req_cloned += &format!("<:reply:1029065416905076808>Not Availible\n"); + pull_req_cloned += "<:reply:1029065416905076808>Not Availible\n"; } + } else if hero.pulls[index].title.is_empty() { + pull_req_cloned += "<:reply_multi:1029067132572549142>Not Availible\n"; } else { - if hero.pulls[index].title.is_empty() { - pull_req_cloned += &format!("<:reply_multi:1029067132572549142>Not Availible\n"); - } else { - pull_req_cloned += &format!( - "<:reply_multi:1029067132572549142>[{}]({})\n", - pr.title, pr.url - ); - } + pull_req_cloned += &format!( + "<:reply_multi:1029067132572549142>[{}]({})\n", + pr.title, pr.url + ); } pull_req = pull_req_cloned @@ -62,7 +60,7 @@ pub async fn run(ctx: Context, command: ApplicationCommandInteraction, hero: Her "`ℹī¸` **Information**\n<:reply_multi:1029067132572549142>**Name:** `{}`\n<:reply_multi:1029067132572549142>**Location:** `{}`\n<:reply_multi:1029067132572549142>**Bio:** {}\n<:reply_multi:1029067132572549142>**Total PRs:** `{}`\n<:reply:1029065416905076808>**Last Activity:** {}\n\n`📙` **Socials**\n<:gh:1029368861776167004> **GitHub:** https://github.com/{}\n<:lkdn:1029410421641326755> **LinkedIn:** {}\n<:twitter:1029410910432935936> **Twitter:** {}\n<:discord:1029412089170767922> **Discord:** {}\n\n`🔗` **Last 3 PRs**\n{}", hero.name.unwrap_or_else(|| "Unknown".to_string()), hero.location.unwrap_or_else(|| "Unknown".to_string()), - hero.bio.unwrap_or_else(|| "Unknown".to_string()).to_string(), + hero.bio.unwrap_or_else(|| "Unknown".to_string()), if let Some(pulls) = hero.total_pulls { format!("{}", pulls) } else {