Skip to content

Commit 6c122f6

Browse files
committed
fix: skip container header if no generics params
1 parent 687889c commit 6c122f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tools/rust-analyzer/crates/hir/src/display.rs

+2-2
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)