refactor: conforms to clippy 1.67 recommandations

This commit is contained in:
VC
2023-02-09 11:32:22 +01:00
parent 6b68c8e299
commit f3b13eb62f
6 changed files with 19 additions and 22 deletions

View File

@@ -83,7 +83,7 @@ pub fn associate_urls(urls: &[UrlEntity], re: &Option<Regex>) -> HashMap<String,
pub fn replace_alt_services(urls: &mut HashMap<String, String>, alts: &HashMap<String, String>) {
for val in urls.values_mut() {
for (k, v) in alts {
*val = val.replace(&format!("/{}/", k), &format!("/{}/", v));
*val = val.replace(&format!("/{k}/"), &format!("/{v}/"));
}
}
}
@@ -120,7 +120,7 @@ pub fn replace_tweet_by_toot(
twitter_screen_name.to_lowercase(),
tweet_id
)) {
*val = format!("{}/@{}/{}", base_url, mastodon_screen_name, toot_id);
*val = format!("{base_url}/@{mastodon_screen_name}/{toot_id}");
}
}
}
@@ -184,7 +184,7 @@ pub async fn register(host: &str, screen_name: &str) {
let url = app_data.url.expect("Cannot generate registration URI!");
println!("Click this link to authorize on Mastodon: {}", url);
println!("Click this link to authorize on Mastodon: {url}");
println!("Paste the returned authorization code: ");
let mut input = String::new();