Skip to content

Commit ab7c7d4

Browse files
committed
fix: skip container header if no generics params
1 parent 9f70f87 commit ab7c7d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/hir/src/display.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ impl HirDisplay for Function {
3636

3737
match container {
3838
Some(AssocItemContainer::Trait(trait_)) => {
39-
if f.show_container_bounds() {
39+
if f.show_container_bounds() && !f.db.generic_params(trait_.id.into()).is_empty() {
4040
write_trait_header(&trait_, f)?;
4141
f.write_str("\n")?;
4242
}
4343
}
4444
Some(AssocItemContainer::Impl(impl_)) => {
45-
if f.show_container_bounds() {
45+
if f.show_container_bounds() && !f.db.generic_params(impl_.id.into()).is_empty() {
4646
write_impl_header(&impl_, f)?;
4747
f.write_str("\n")?;
4848
}

0 commit comments

Comments
 (0)