Adds a missing 'when'

pull/121/head
hoijui 3 years ago committed by GitHub
parent 921df25b51
commit 58cebf4ced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4777,7 +4777,7 @@ This prints `0` because `.unwrap_or(&0)` gives a 0 even if it is a `None`.
## Traits
We have seen traits before: `Debug`, `Copy`, `Clone` are all traits. To give a type a trait, you have to implement it. Because `Debug` and the others are so common, we have attributes that automatically do it. That's what happens you write `#[derive(Debug)]`: you are automatically implementing `Debug`.
We have seen traits before: `Debug`, `Copy`, `Clone` are all traits. To give a type a trait, you have to implement it. Because `Debug` and the others are so common, we have attributes that automatically do it. That's what happens when you write `#[derive(Debug)]`: you are automatically implementing `Debug`.
```rust
#[derive(Debug)]

Loading…
Cancel
Save