refactor: clippy::useless_vec (#974)

Lint enabled by default but only nightly finds this yet
This commit is contained in:
EdJoPaTo 2024-03-02 11:18:29 +01:00 committed by Josh McKinney
parent 525848ff4e
commit f1398ae6cb
No known key found for this signature in database
GPG key ID: 722287396A903BC5

View file

@ -348,7 +348,7 @@ mod tests {
// format!() is used to create a temporary String inside a closure, which suffers the same // format!() is used to create a temporary String inside a closure, which suffers the same
// issue as above without the `Styled` trait impl for `String` // issue as above without the `Styled` trait impl for `String`
let items = vec![String::from("a"), String::from("b")]; let items = [String::from("a"), String::from("b")];
let sss = items.iter().map(|s| format!("{s}{s}").red()).collect_vec(); let sss = items.iter().map(|s| format!("{s}{s}").red()).collect_vec();
assert_eq!(sss, vec![Span::from("aa").red(), Span::from("bb").red()]); assert_eq!(sss, vec![Span::from("aa").red(), Span::from("bb").red()]);
} }