diff --git a/Cargo.toml b/Cargo.toml index 81a1e64a..a044bc86 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,6 +67,7 @@ unsafe_code = "forbid" cloned_instead_of_copied = "warn" explicit_iter_loop = "warn" implicit_clone = "warn" +inefficient_to_string = "warn" missing_const_for_fn = "warn" needless_for_each = "warn" semicolon_if_nothing_returned = "warn" diff --git a/src/widgets/list.rs b/src/widgets/list.rs index 8456eccf..cb765407 100755 --- a/src/widgets/list.rs +++ b/src/widgets/list.rs @@ -1197,7 +1197,7 @@ mod tests { /// helper method to take a vector of strings and return a vector of list items fn list_items(items: Vec<&str>) -> Vec { - 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