Skip to content

Commit 060f6bf

Browse files
committed
rustc: remove the closure from ppaux's p! macro (by making ? implicit).
1 parent cb8a1f0 commit 060f6bf

File tree

2 files changed

+118
-130
lines changed

2 files changed

+118
-130
lines changed

src/librustc/ty/print.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,12 +610,12 @@ impl<P: PrettyPrinter> PrintCx<'a, 'gcx, 'tcx, P> {
610610
) -> Result<P::Path, P::Error> {
611611
let mut empty = true;
612612
let mut start_or_continue = |cx: &mut Self, start: &str, cont: &str| {
613-
if empty {
613+
write!(cx.printer, "{}", if empty {
614614
empty = false;
615-
write!(cx.printer, "{}", start)
615+
start
616616
} else {
617-
write!(cx.printer, "{}", cont)
618-
}
617+
cont
618+
})
619619
};
620620

621621
let start = if ns == Namespace::ValueNS { "::<" } else { "<" };

0 commit comments

Comments
 (0)