1
Fork 0

Improve code

This commit is contained in:
Guillaume Gomez 2018-07-21 13:35:29 +02:00
parent 6b830ec23e
commit d64c2ac01a
5 changed files with 47 additions and 67 deletions

View file

@ -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);