mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
Fix most Clippy performance warnings
command used: cargo clippy -- -W clippy::perf
This commit is contained in:
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -316,7 +316,7 @@ impl DebugDocBuilder {
|
||||
result = result + item;
|
||||
}
|
||||
|
||||
result.into()
|
||||
result
|
||||
}
|
||||
|
||||
fn styled(string: impl std::fmt::Display, style: ShellStyle) -> DebugDocBuilder {
|
||||
|
Reference in New Issue
Block a user