We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ad8efa commit 035d60dCopy full SHA for 035d60d
src/comp/pretty/pprust.rs
@@ -503,9 +503,11 @@ fn print_block(&ps s, ast::block blk) {
503
}
504
505
fn print_if(&ps s, &@ast::expr test, &ast::block block,
506
- &option::t[@ast::expr] elseopt, &str chk) {
+ &option::t[@ast::expr] elseopt, bool chk) {
507
head(s, "if");
508
- word_space(s, chk);
+ if (chk) {
509
+ word_nbsp(s, "check");
510
+ }
511
popen(s);
512
print_expr(s, test);
513
pclose(s);
@@ -651,10 +653,10 @@ fn print_expr(&ps s, &@ast::expr expr) {
651
653
print_type(s, *ty);
652
654
655
case (ast::expr_if(?test, ?block, ?elseopt, _)) {
- print_if(s, test, block, elseopt, "");
656
+ print_if(s, test, block, elseopt, false);
657
658
case (ast::expr_if_check(?test, ?block, ?elseopt, _)) {
- print_if(s, test, block, elseopt, "check");
659
+ print_if(s, test, block, elseopt, true);
660
661
case (ast::expr_while(?test, ?block, _)) {
662
head(s, "while");
0 commit comments