File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -54,9 +54,9 @@ The second is that the syntax is similar, but a bit different. I’ve added spac
54
54
here to make them look a little closer:
55
55
56
56
``` rust
57
- fn plus_one_v1 (x : i32 ) -> i32 { x + 1 }
58
- let plus_one_v2 = | x : i32 | -> i32 { x + 1 };
59
- let plus_one_v3 = | x : i32 | x + 1 ;
57
+ fn plus_one_v1 (x : i32 ) -> i32 { x + 1 }
58
+ let plus_one_v2 = | x : i32 | -> i32 { x + 1 };
59
+ let plus_one_v3 = | x : i32 | x + 1 ;
60
60
```
61
61
62
62
Small differences, but they’re similar in ways.
@@ -136,7 +136,7 @@ This gives us:
136
136
note: `nums` moved into closure environment here because it has type
137
137
`[closure(()) -> collections::vec::Vec<i32>]`, which is non-copyable
138
138
let takes_nums = || nums;
139
- ^~~~~~~
139
+ ^~~~~~~
140
140
```
141
141
142
142
` Vec<T> ` has ownership over its contents, and therefore, when we refer to it
@@ -352,8 +352,8 @@ error: the trait `core::marker::Sized` is not implemented for the type
352
352
factory() -> (Fn(i32) -> Vec<i32>) {
353
353
^~~~~~~~~~~~~~~~~~~~~
354
354
note: `core::ops::Fn(i32) -> collections::vec::Vec<i32>` does not have a constant size known at compile-time
355
- fa ctory () -> (Fn(i32) -> Vec<i32>) {
356
- ^~~~~~~~~~~~~~~~~~~~~
355
+ factory () -> (Fn(i32) -> Vec<i32>) {
356
+ ^~~~~~~~~~~~~~~~~~~~~
357
357
358
358
```
359
359
You can’t perform that action at this time.
0 commit comments