File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 2
2
minutes : 10
3
3
---
4
4
5
- # Closures
5
+ # Closure traits
6
6
7
7
Closures or lambda expressions have types which cannot be named. However, they
8
8
implement special [ ` Fn ` ] ( https://doc.rust-lang.org/std/ops/trait.Fn.html ) ,
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ fn main() {
52
52
- It is possible to write ` impl VerbosityFilter<StderrLogger> { .. } ` .
53
53
- ` VerbosityFilter ` is still generic and you can use ` VerbosityFilter<f64> ` ,
54
54
but methods in this block will only be available for
55
- ` Point <StderrLogger>` .
55
+ ` VerbosityFilter <StderrLogger>` .
56
56
- Note that we don't put a trait bound on the ` VerbosityFilter ` type itself. You
57
57
can put bounds there as well, but generally in Rust we only put the trait
58
58
bounds on the impl blocks.
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ fn main() {
25
25
26
26
<details >
27
27
28
- - Try making a ` NonCloneable ` and passing it to ` duplicate ` .
28
+ - Try making a ` NotCloneable ` and passing it to ` duplicate ` .
29
29
30
30
- When multiple traits are necessary, use ` + ` to join them.
31
31
Original file line number Diff line number Diff line change @@ -72,10 +72,10 @@ impl PartialOrd for Citation {
72
72
- In practice, it's common to derive these traits, but uncommon to implement
73
73
them.
74
74
75
- - When comparing references in Rust, it will will compare the value of the
76
- things pointed to, it will NOT compare the references themselves. That means
77
- that references to two different things can compare as equal if the values
78
- pointed to are the same:
75
+ - When comparing references in Rust, it will compare the value of the things
76
+ pointed to, it will NOT compare the references themselves. That means that
77
+ references to two different things can compare as equal if the values pointed
78
+ to are the same:
79
79
80
80
``` rust,editable
81
81
fn main() {
You can’t perform that action at this time.
0 commit comments