Skip to content

Commit 30d3d68

Browse files
committed
Fix unwanted leading whitespace in hover text
PR rust-lang#16366 moved layout information to a separate line, so the leading whitespace is no longer necessary.
1 parent a2e2741 commit 30d3d68

File tree

2 files changed

+65
-65
lines changed

2 files changed

+65
-65
lines changed

crates/ide/src/hover/render.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ fn render_notable_trait_comment(
510510
let mut needs_impl_header = true;
511511
for (trait_, assoc_types) in notable_traits {
512512
desc.push_str(if mem::take(&mut needs_impl_header) {
513-
" // Implements notable traits: "
513+
"// Implements notable traits: "
514514
} else {
515515
", "
516516
});
@@ -661,7 +661,7 @@ fn closure_ty(
661661
if let Some(layout) =
662662
render_memory_layout(config.memory_layout, || original.layout(sema.db), |_| None, |_| None)
663663
{
664-
format_to!(markup, "{layout}");
664+
format_to!(markup, " {layout}");
665665
}
666666
if let Some(trait_) = c.fn_trait(sema.db).get_id(sema.db, original.krate(sema.db).into()) {
667667
push_new_def(hir::Trait::from(trait_).into())
@@ -730,7 +730,7 @@ fn render_memory_layout(
730730
let config = config?;
731731
let layout = layout().ok()?;
732732

733-
let mut label = String::from(" // ");
733+
let mut label = String::from("// ");
734734

735735
if let Some(render) = config.size {
736736
let size = match tag(&layout) {

0 commit comments

Comments
 (0)