Skip to content

Commit a143114

Browse files
committed
06: closures_syntax: format for no rust-analyzer
1 parent c300a5f commit a143114

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

content/lessons/06_closures_iterators/closures_syntax.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
fn main() {
22
#[rustfmt::skip]
33
{
4-
// This is formatted so that with rust-analyzer it renders as well-aligned.
4+
// This is formatted so that without rust-analyzer it renders as well-aligned.
55

6-
fn add_one_v1 (x: u32) -> u32 { x + 1 } // This is an ordinary function.
6+
fn add_one_v1 (x: u32) -> u32 { x + 1 } // This is an ordinary function.
77
let add_one_v2 = |x: u32| -> u32 { x + 1 }; // Closures use pipes instead of parentheses.
8-
let add_one_v3 = |x| { x + 1 }; // Both parameters and return value can have their types inferred.
9-
let add_one_v4 = |x| x + 1 ; // If the body is a single expression, braces can be omitted.
8+
let add_one_v3 = |x| { x + 1 }; // Both parameters and return value can have their types inferred.
9+
let add_one_v4 = |x| x + 1 ; // If the body is a single expression, braces can be omitted.
1010

1111
let _res = add_one_v1(0_u32);
1212
let _res = add_one_v2(0_u32);

0 commit comments

Comments
 (0)