refactor: clippy::inefficient_to_string (#974)

This commit is contained in:
EdJoPaTo 2024-02-27 13:34:22 +01:00 committed by Josh McKinney
parent a558b19c9a
commit 8536760e78
No known key found for this signature in database
GPG key ID: 722287396A903BC5
2 changed files with 2 additions and 1 deletions

View file

@ -67,6 +67,7 @@ unsafe_code = "forbid"
cloned_instead_of_copied = "warn" cloned_instead_of_copied = "warn"
explicit_iter_loop = "warn" explicit_iter_loop = "warn"
implicit_clone = "warn" implicit_clone = "warn"
inefficient_to_string = "warn"
missing_const_for_fn = "warn" missing_const_for_fn = "warn"
needless_for_each = "warn" needless_for_each = "warn"
semicolon_if_nothing_returned = "warn" semicolon_if_nothing_returned = "warn"

View file

@ -1197,7 +1197,7 @@ mod tests {
/// helper method to take a vector of strings and return a vector of list items /// helper method to take a vector of strings and return a vector of list items
fn list_items(items: Vec<&str>) -> Vec<ListItem> { fn list_items(items: Vec<&str>) -> Vec<ListItem> {
items.iter().map(|i| ListItem::new(i.to_string())).collect() items.into_iter().map(ListItem::new).collect()
} }
/// helper method to render a widget to an empty buffer with the default state /// helper method to render a widget to an empty buffer with the default state