mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-05-16 23:55:42 +02:00
Correct minor typos in slide notes (#2687)
- There's a `NotCloneable` in the code, no `NonCloneable` - Point<StderrLogger> doesn't make sense in this context
This commit is contained in:
parent
7f45460811
commit
b24914a247
@ -2,7 +2,7 @@
|
||||
minutes: 10
|
||||
---
|
||||
|
||||
# Closures
|
||||
# Closure traits
|
||||
|
||||
Closures or lambda expressions have types which cannot be named. However, they
|
||||
implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html),
|
||||
|
@ -52,7 +52,7 @@ fn main() {
|
||||
- It is possible to write `impl VerbosityFilter<StderrLogger> { .. }`.
|
||||
- `VerbosityFilter` is still generic and you can use `VerbosityFilter<f64>`,
|
||||
but methods in this block will only be available for
|
||||
`Point<StderrLogger>`.
|
||||
`VerbosityFilter<StderrLogger>`.
|
||||
- Note that we don't put a trait bound on the `VerbosityFilter` type itself. You
|
||||
can put bounds there as well, but generally in Rust we only put the trait
|
||||
bounds on the impl blocks.
|
||||
|
@ -25,7 +25,7 @@ fn main() {
|
||||
|
||||
<details>
|
||||
|
||||
- Try making a `NonCloneable` and passing it to `duplicate`.
|
||||
- Try making a `NotCloneable` and passing it to `duplicate`.
|
||||
|
||||
- When multiple traits are necessary, use `+` to join them.
|
||||
|
||||
|
@ -72,10 +72,10 @@ impl PartialOrd for Citation {
|
||||
- In practice, it's common to derive these traits, but uncommon to implement
|
||||
them.
|
||||
|
||||
- When comparing references in Rust, it will will compare the value of the
|
||||
things pointed to, it will NOT compare the references themselves. That means
|
||||
that references to two different things can compare as equal if the values
|
||||
pointed to are the same:
|
||||
- When comparing references in Rust, it will compare the value of the things
|
||||
pointed to, it will NOT compare the references themselves. That means that
|
||||
references to two different things can compare as equal if the values pointed
|
||||
to are the same:
|
||||
|
||||
```rust,editable
|
||||
fn main() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user