Avoid extraneous space between visibility kw and ident for statics
Today, given a static like `static mut FOO: usize = 1`, rustdoc would emit `static mut FOO: usize = 1`, as it emits both the mutability kw with a space and reserves a space after the mutability kw. This patch fixes that misformatting. This patch also adds some tests for emit of other statics, as I could not find an existing test devoted to statics.
This commit is contained in:
parent
d65c08e9cc
commit
abfbd1bd71
2 changed files with 13 additions and 1 deletions
|
@ -2289,7 +2289,7 @@ fn item_static(w: &mut Buffer, cx: &Context, it: &clean::Item, s: &clean::Static
|
|||
render_attributes(w, it, false);
|
||||
write!(
|
||||
w,
|
||||
"{vis}static {mutability} {name}: {typ}</pre>",
|
||||
"{vis}static {mutability}{name}: {typ}</pre>",
|
||||
vis = it.visibility.print_with_space(),
|
||||
mutability = s.mutability.print_with_space(),
|
||||
name = it.name.as_ref().unwrap(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue