mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 06:03:58 +00:00
fix: skip container header if no generics params
This commit is contained in:
parent
9f70f87d35
commit
ab7c7d4501
1 changed files with 2 additions and 2 deletions
|
@ -36,13 +36,13 @@ impl HirDisplay for Function {
|
||||||
|
|
||||||
match container {
|
match container {
|
||||||
Some(AssocItemContainer::Trait(trait_)) => {
|
Some(AssocItemContainer::Trait(trait_)) => {
|
||||||
if f.show_container_bounds() {
|
if f.show_container_bounds() && !f.db.generic_params(trait_.id.into()).is_empty() {
|
||||||
write_trait_header(&trait_, f)?;
|
write_trait_header(&trait_, f)?;
|
||||||
f.write_str("\n")?;
|
f.write_str("\n")?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some(AssocItemContainer::Impl(impl_)) => {
|
Some(AssocItemContainer::Impl(impl_)) => {
|
||||||
if f.show_container_bounds() {
|
if f.show_container_bounds() && !f.db.generic_params(impl_.id.into()).is_empty() {
|
||||||
write_impl_header(&impl_, f)?;
|
write_impl_header(&impl_, f)?;
|
||||||
f.write_str("\n")?;
|
f.write_str("\n")?;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue