Fix a new clippy lint

This commit is contained in:
Wojciech Kozlowski 2024-08-24 14:58:24 +02:00
parent e35b45a792
commit 86f539d1f6

View File

@ -231,13 +231,13 @@ impl<'a> ArtistOverlay<'a> {
let indent = format!("\n{item_indent}");
let list = vec
.iter()
.map(|(k, v)| format!("{k}: {}", Self::vec_to_string(v, list_indent)))
.map(|(k, v)| format!("{k}: {}", Self::slice_to_string(v, list_indent)))
.collect::<Vec<String>>()
.join(&indent);
format!("{indent}{list}")
}
fn vec_to_string<S: AsRef<str>>(vec: &Vec<S>, indent: &str) -> String {
fn slice_to_string<S: AsRef<str>>(vec: &[S], indent: &str) -> String {
if vec.len() < 2 {
vec.first()
.map(|item| item.as_ref())