Skip to content

Commit

Permalink
rustdoc: don't add a space before { on traits with where clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
QuietMisdreavus committed Apr 4, 2017
1 parent 6bc3d65 commit 5bffa0a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2045,13 +2045,18 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
// Output the trait definition
write!(w, "<pre class='rust trait'>")?;
render_attributes(w, it)?;
write!(w, "{}{}trait {}{}{}{} ",
write!(w, "{}{}trait {}{}{}",
VisSpace(&it.visibility),
UnsafetySpace(t.unsafety),
it.name.as_ref().unwrap(),
t.generics,
bounds,
WhereClause { gens: &t.generics, indent: 0, end_newline: true })?;
bounds)?;

if !t.generics.where_predicates.is_empty() {
write!(w, "{}", WhereClause { gens: &t.generics, indent: 0, end_newline: true })?;
} else {
write!(w, " ")?;
}

let types = t.items.iter().filter(|m| m.is_associated_type()).collect::<Vec<_>>();
let consts = t.items.iter().filter(|m| m.is_associated_const()).collect::<Vec<_>>();
Expand Down

0 comments on commit 5bffa0a

Please sign in to comment.