Fix rustdoc formatting of impls
Some cases displayed negative impls as positive, and some were missing where clauses. This factors all the impl formatting into one function so the different cases can't get out of sync again.
This commit is contained in:
@@ -540,6 +540,19 @@ impl fmt::Display for clean::Type {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for clean::Impl {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
try!(write!(f, "impl{} ", self.generics));
|
||||
if let Some(ref ty) = self.trait_ {
|
||||
try!(write!(f, "{}{} for ",
|
||||
if self.polarity == Some(clean::ImplPolarity::Negative) { "!" } else { "" },
|
||||
*ty));
|
||||
}
|
||||
try!(write!(f, "{}{}", self.for_, WhereClause(&self.generics)));
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for clean::Arguments {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
for (i, input) in self.values.iter().enumerate() {
|
||||
|
||||
Reference in New Issue
Block a user