Fix unwanted leading whitespace in hover text

PR #16366 moved layout information to a separate line, so the
leading whitespace is no longer necessary.
This commit is contained in:
Wilfred Hughes 2024-03-12 12:27:57 -07:00
parent a2e274142f
commit 30d3d68044
2 changed files with 65 additions and 65 deletions

View file

@ -510,7 +510,7 @@ fn render_notable_trait_comment(
let mut needs_impl_header = true; let mut needs_impl_header = true;
for (trait_, assoc_types) in notable_traits { for (trait_, assoc_types) in notable_traits {
desc.push_str(if mem::take(&mut needs_impl_header) { desc.push_str(if mem::take(&mut needs_impl_header) {
" // Implements notable traits: " "// Implements notable traits: "
} else { } else {
", " ", "
}); });
@ -661,7 +661,7 @@ fn closure_ty(
if let Some(layout) = if let Some(layout) =
render_memory_layout(config.memory_layout, || original.layout(sema.db), |_| None, |_| None) render_memory_layout(config.memory_layout, || original.layout(sema.db), |_| None, |_| None)
{ {
format_to!(markup, "{layout}"); format_to!(markup, " {layout}");
} }
if let Some(trait_) = c.fn_trait(sema.db).get_id(sema.db, original.krate(sema.db).into()) { if let Some(trait_) = c.fn_trait(sema.db).get_id(sema.db, original.krate(sema.db).into()) {
push_new_def(hir::Trait::from(trait_).into()) push_new_def(hir::Trait::from(trait_).into())
@ -730,7 +730,7 @@ fn render_memory_layout(
let config = config?; let config = config?;
let layout = layout().ok()?; let layout = layout().ok()?;
let mut label = String::from(" // "); let mut label = String::from("// ");
if let Some(render) = config.size { if let Some(render) = config.size {
let size = match tag(&layout) { let size = match tag(&layout) {