about summary refs log tree commit diff
path: root/src/librustdoc
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-09-05 14:15:52 +0530
committerGitHub <noreply@github.com>2022-09-05 14:15:52 +0530
commite4534fe6fef5452a5f2fd42927c933e06d8ec1b8 (patch)
treef1695ecd78fcb40279826a43c2f61f2a07da2298 /src/librustdoc
parentd18dc3d2ab0e63be6ce00142d8cdced48447782c (diff)
parent6f4726541e56ae02a7e31cc42d1d14df81848c58 (diff)
downloadrust-e4534fe6fef5452a5f2fd42927c933e06d8ec1b8.tar.gz
rust-e4534fe6fef5452a5f2fd42927c933e06d8ec1b8.zip
Rollup merge of #101391 - matthiaskrgr:perf0309, r=oli-obk
more clippy::perf fixes
Diffstat (limited to 'src/librustdoc')
-rw-r--r--src/librustdoc/html/render/mod.rs4
-rw-r--r--src/librustdoc/html/render/write_shared.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index 7577c719623..1e6f20d2b49 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -2367,9 +2367,9 @@ pub(crate) fn get_filtered_impls_for_reference<'a>(
     let Some(v) = shared.cache.impls.get(&def_id) else { return (Vec::new(), Vec::new(), Vec::new()) };
     // Since there is no "direct implementation" on the reference primitive type, we filter out
     // every implementation which isn't a trait implementation.
-    let traits: Vec<_> = v.iter().filter(|i| i.inner_impl().trait_.is_some()).collect();
+    let traits = v.iter().filter(|i| i.inner_impl().trait_.is_some());
     let (synthetic, concrete): (Vec<&Impl>, Vec<&Impl>) =
-        traits.into_iter().partition(|t| t.inner_impl().kind.is_auto());
+        traits.partition(|t| t.inner_impl().kind.is_auto());
 
     let (blanket_impl, concrete): (Vec<&Impl>, _) =
         concrete.into_iter().partition(|t| t.inner_impl().kind.is_blanket());
diff --git a/src/librustdoc/html/render/write_shared.rs b/src/librustdoc/html/render/write_shared.rs
index f9abb46207d..fc4d46fe6b6 100644
--- a/src/librustdoc/html/render/write_shared.rs
+++ b/src/librustdoc/html/render/write_shared.rs
@@ -312,7 +312,7 @@ pub(super) fn write_shared(
                 if line.starts_with(&prefix) {
                     continue;
                 }
-                if line.ends_with(",") {
+                if line.ends_with(',') {
                     ret.push(line[..line.len() - 1].to_string());
                 } else {
                     // No comma (it's the case for the last added crate line)