]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/ty/print.rs
rustc: remove the closure from ppaux's p! macro (by making ? implicit).
[rust.git] / src / librustc / ty / print.rs
index d385d183e2b32ee18c1f6520176c051792b2dcee..005dd18177d2380ea444a54ff7277817aa9b9122 100644 (file)
@@ -611,12 +611,12 @@ pub fn pretty_path_generic_args(
     ) -> Result<P::Path, P::Error> {
         let mut empty = true;
         let mut start_or_continue = |cx: &mut Self, start: &str, cont: &str| {
-            if empty {
+            write!(cx.printer, "{}", if empty {
                 empty = false;
-                write!(cx.printer, "{}", start)
+                start
             } else {
-                write!(cx.printer, "{}", cont)
-            }
+                cont
+            })
         };
 
         let start = if ns == Namespace::ValueNS { "::<" } else { "<" };