error: incorrect close delimiter: `}` --> $DIR/token-error-correct-3.rs:30:9 | 30 | } else { //~ ERROR: incorrect close delimiter: `}` | ^ | note: unclosed delimiter --> $DIR/token-error-correct-3.rs:24:21 | 24 | callback(path.as_ref(); //~ ERROR expected one of | ^ error: expected one of `,`, `.`, `?`, or an operator, found `;` --> $DIR/token-error-correct-3.rs:24:35 | 24 | callback(path.as_ref(); //~ ERROR expected one of | ^ expected one of `,`, `.`, `?`, or an operator here error: expected one of `.`, `;`, `?`, `}`, or an operator, found `)` --> $DIR/token-error-correct-3.rs:30:9 | 25 | fs::create_dir_all(path.as_ref()).map(|()| true) //~ ERROR: mismatched types | - expected one of `.`, `;`, `?`, `}`, or an operator here ... 30 | } else { //~ ERROR: incorrect close delimiter: `}` | ^ unexpected token error[E0425]: cannot find function `is_directory` in this scope --> $DIR/token-error-correct-3.rs:23:13 | 23 | if !is_directory(path.as_ref()) { //~ ERROR: cannot find function `is_directory` | ^^^^^^^^^^^^ not found in this scope error[E0308]: mismatched types --> $DIR/token-error-correct-3.rs:25:13 | 25 | fs::create_dir_all(path.as_ref()).map(|()| true) //~ ERROR: mismatched types | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try adding a semicolon: `;` | | | expected (), found enum `std::result::Result` | = note: expected type `()` found type `std::result::Result` error: aborting due to 5 previous errors You've got a few errors: E0308, E0425 If you want more information on an error, try using "rustc --explain E0308"