Skip to content

Commit ed10418

Browse files
committed
Inline and remove State::print_item_type.
It has a single call site. The removal of the closure argument is a nice touch.
1 parent d7029d7 commit ed10418

1 file changed

Lines changed: 11 additions & 22 deletions

File tree

  • compiler/rustc_hir_pretty/src

‎compiler/rustc_hir_pretty/src/lib.rs‎

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -553,24 +553,6 @@ impl<'a> State<'a> {
553553
self.word(";")
554554
}
555555

556-
fnprint_item_type(
557-
&mutself,
558-
item:&hir::Item<'_>,
559-
generics:&hir::Generics<'_>,
560-
inner:implFn(&mutSelf),
561-
){
562-
self.head("type");
563-
self.print_ident(item.ident);
564-
self.print_generic_params(generics.params);
565-
self.end();// end the inner ibox
566-
567-
self.print_where_clause(generics);
568-
self.space();
569-
inner(self);
570-
self.word(";");
571-
self.end();// end the outer ibox
572-
}
573-
574556
fnprint_item(&mutself,item:&hir::Item<'_>){
575557
self.hardbreak_if_not_bol();
576558
self.maybe_print_comment(item.span.lo());
@@ -683,10 +665,17 @@ impl<'a> State<'a> {
683665
self.end()
684666
}
685667
hir::ItemKind::TyAlias(ty, generics) => {
686-
self.print_item_type(item, generics, |state| {
687-
state.word_space("=");
688-
state.print_type(ty);
689-
});
668+
self.head("type");
669+
self.print_ident(item.ident);
670+
self.print_generic_params(generics.params);
671+
self.end();// end the inner ibox
672+
673+
self.print_where_clause(generics);
674+
self.space();
675+
self.word_space("=");
676+
self.print_type(ty);
677+
self.word(";");
678+
self.end();// end the outer ibox
690679
}
691680
hir::ItemKind::Enum(ref enum_definition, params) => {
692681
self.print_enum_def(enum_definition, params, item.ident.name, item.span);

0 commit comments

Comments
 (0)