about summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2018-07-21 13:35:29 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2018-07-22 21:03:21 +0200
commitd64c2ac01a831d9936d155fd38eaa53ffe672893 (patch)
tree788ee871000e5b4f9a87b5fe67c6e1c7a19de444 /src/librustdoc/html
parent6b830ec23e25f3e325e97fc49b0bec9a7f2a5b53 (diff)
downloadrust-d64c2ac01a831d9936d155fd38eaa53ffe672893.tar.gz
rust-d64c2ac01a831d9936d155fd38eaa53ffe672893.zip
Improve code
Diffstat (limited to 'src/librustdoc/html')
-rw-r--r--src/librustdoc/html/render.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 214f2da212e..fd39202b87c 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -3628,16 +3628,7 @@ fn render_assoc_items(w: &mut fmt::Formatter,
 
         let (synthetic, concrete) = traits
             .iter()
-            .partition::<Vec<&&Impl>, _>(|t| t.inner_impl().synthetic);
-
-        // ugly hacks to remove duplicates.
-        let synthetic = synthetic.into_iter()
-                                 .filter(|t| {
-            !concrete.iter()
-                     .any(|tt| {
-                         tt.inner_impl().trait_.def_id() == t.inner_impl().trait_.def_id()
-                     })
-        }).collect::<Vec<_>>();
+            .partition::<Vec<_>, _>(|t| t.inner_impl().synthetic);
 
         struct RendererStruct<'a, 'b, 'c>(&'a Context, Vec<&'b &'b Impl>, &'c clean::Item);