Fix most Clippy performance warnings

command used: cargo clippy -- -W clippy::perf
This commit is contained in:
Thibaut Brandscheid
2019-12-06 16:28:26 +01:00
parent 5622bbdd48
commit cde92a9fb9
57 changed files with 320 additions and 350 deletions

View File

@ -38,7 +38,7 @@ impl Spanned<String> {
pub fn items<'a, U>(
items: impl Iterator<Item = &'a Spanned<String>>,
) -> impl Iterator<Item = &'a str> {
items.into_iter().map(|item| &item.item[..])
items.map(|item| &item.item[..])
}
}
@ -156,7 +156,7 @@ impl<T> Tagged<T> {
Tagged {
item: self.item,
tag: tag,
tag,
}
}

View File

@ -316,7 +316,7 @@ impl DebugDocBuilder {
result = result + item;
}
result.into()
result
}
fn styled(string: impl std::fmt::Display, style: ShellStyle) -> DebugDocBuilder {