Skip to content

Commit

Permalink
Merge pull request #33 from wada314/master
Browse files Browse the repository at this point in the history
Update the type alias's `where` clause position according to rust-lang issue #89122
  • Loading branch information
dtolnay authored Jan 5, 2023
2 parents e07d1bf + c1709d0 commit 88079f5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,13 +631,11 @@ impl Printer {
self.type_param_bound(&bound);
}
if let Some((_eq_token, default)) = &trait_item.default {
self.where_clause_oneline(&trait_item.generics.where_clause);
self.word("= ");
self.word(" = ");
self.neverbreak();
self.ty(default);
} else {
self.where_clause_oneline_semi(&trait_item.generics.where_clause);
}
self.where_clause_oneline_semi(&trait_item.generics.where_clause);
self.end();
self.hardbreak();
}
Expand Down Expand Up @@ -728,13 +726,12 @@ impl Printer {
self.word("type ");
self.ident(&impl_item.ident);
self.generics(&impl_item.generics);
self.where_clause_oneline(&impl_item.generics.where_clause);
self.word("= ");
self.word(" = ");
self.neverbreak();
self.ibox(-INDENT);
self.ty(&impl_item.ty);
self.end();
self.word(";");
self.where_clause_oneline_semi(&impl_item.generics.where_clause);
self.end();
self.hardbreak();
}
Expand Down

0 comments on commit 88079f5

Please sign in to comment.