Skip to content

Commit

Permalink
Auto merge of rust-lang#16824 - Wilfred:size_whitespace, r=lnicola
Browse files Browse the repository at this point in the history
minor: 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.
  • Loading branch information
bors committed Mar 13, 2024
2 parents a2e2741 + 30d3d68 commit e8182a5
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 65 deletions.
6 changes: 3 additions & 3 deletions crates/ide/src/hover/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ fn render_notable_trait_comment(
let mut needs_impl_header = true;
for (trait_, assoc_types) in notable_traits {
desc.push_str(if mem::take(&mut needs_impl_header) {
" // Implements notable traits: "
"// Implements notable traits: "
} else {
", "
});
Expand Down Expand Up @@ -661,7 +661,7 @@ fn closure_ty(
if let Some(layout) =
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()) {
push_new_def(hir::Trait::from(trait_).into())
Expand Down Expand Up @@ -730,7 +730,7 @@ fn render_memory_layout(
let config = config?;
let layout = layout().ok()?;

let mut label = String::from(" // ");
let mut label = String::from("// ");

if let Some(render) = config.size {
let size = match tag(&layout) {
Expand Down
Loading

0 comments on commit e8182a5

Please sign in to comment.