diff options
author | Geert-Jan Zwiers <geertjanzwiers@protonmail.com> | 2023-01-26 23:24:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-26 23:24:03 +0100 |
commit | 7f38f30a5c0eb06c5b85d1c7ac26a480c210aab6 (patch) | |
tree | 805c717b5aaf7124a09a3f19f6d2c2d459d2d959 /cli/lsp/performance.rs | |
parent | 21065797f6dce285e55705007f54abe2bafb611c (diff) |
refactor(lsp): fewer clones (#17551)
Diffstat (limited to 'cli/lsp/performance.rs')
-rw-r--r-- | cli/lsp/performance.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/lsp/performance.rs b/cli/lsp/performance.rs index 72bec20ab..717ae792d 100644 --- a/cli/lsp/performance.rs +++ b/cli/lsp/performance.rs @@ -121,10 +121,11 @@ impl Performance { averages .into_iter() .map(|(k, d)| { - let a = d.clone().into_iter().sum::<Duration>() / d.len() as u32; + let count = d.len() as u32; + let a = d.into_iter().sum::<Duration>() / count; PerformanceAverage { name: k, - count: d.len() as u32, + count, average_duration: a.as_millis() as u32, } }) |