Skip to content

Commit d993429

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

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
@@ -614,12 +614,12 @@ impl<P: PrettyPrinter> PrintCx<'a, 'gcx, 'tcx, P> {
614614
) -> Result<P::Path, P::Error> {
615615
let mut empty = true;
616616
let mut start_or_continue = |cx: &mut Self, start: &str, cont: &str| {
617-
if empty {
617+
write!(cx.printer, "{}", if empty {
618618
empty = false;
619-
write!(cx.printer, "{}", start)
619+
start
620620
} else {
621-
write!(cx.printer, "{}", cont)
622-
}
621+
cont
622+
})
623623
};
624624

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

0 commit comments

Comments
 (0)