Update src/librustdoc/html/render/print_item.rs

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
This commit is contained in:
Manish Goregaokar 2021-03-22 09:08:58 -07:00
parent e2f59f41f9
commit 846a4e9b5c

View file

@ -1306,7 +1306,7 @@ fn render_union(
write!(w, " {{\n{}", tab);
let count_fields = fields
.iter()
.filter(|f| if let clean::StructFieldItem(..) = *f.kind { true } else { false })
.filter(|f| matches!(clean::StructFieldItem(..), *f.kind))
.count();
let toggle = should_hide_fields(count_fields);
if toggle {