Skip to content

Commit ab5d6fb

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

File tree

2 files changed

+122
-134
lines changed

2 files changed

+122
-134
lines changed

src/librustc/ty/print.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,12 +611,12 @@ impl<P: PrettyPrinter> PrintCx<'a, 'gcx, 'tcx, P> {
611611
) -> Result<P::Path, P::Error> {
612612
let mut empty = true;
613613
let mut start_or_continue = |cx: &mut Self, start: &str, cont: &str| {
614-
if empty {
614+
write!(cx.printer, "{}", if empty {
615615
empty = false;
616-
write!(cx.printer, "{}", start)
616+
start
617617
} else {
618-
write!(cx.printer, "{}", cont)
619-
}
618+
cont
619+
})
620620
};
621621

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

0 commit comments

Comments
 (0)