1
Fork 0

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:52 -07:00
parent 256e594b0a
commit e2f59f41f9

View file

@ -1363,7 +1363,7 @@ fn render_struct(
w.write_str(" {");
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 has_visible_fields = count_fields > 0;
let toggle = should_hide_fields(count_fields);