mirror of
https://github.com/mainmatter/100-exercises-to-learn-rust
synced 2024-12-25 21:58:26 +01:00
typos (#41)
* that to than * add missing s * an to a Next letter is a consonant sound
This commit is contained in:
parent
ab39f443dc
commit
aecd6e6180
4 changed files with 4 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
# `Sized`
|
# `Sized`
|
||||||
|
|
||||||
There's more to `&str` that meets the eye, even after having
|
There's more to `&str` than meets the eye, even after having
|
||||||
investigated deref coercion.
|
investigated deref coercion.
|
||||||
From our previous [discussion on memory layouts](../03_ticket_v1/10_references_in_memory.md),
|
From our previous [discussion on memory layouts](../03_ticket_v1/10_references_in_memory.md),
|
||||||
it would have been reasonable to expect `&str` to be represented as a single `usize` on
|
it would have been reasonable to expect `&str` to be represented as a single `usize` on
|
||||||
|
|
|
@ -76,7 +76,7 @@ where
|
||||||
// This is known as a **trait bound**
|
// This is known as a **trait bound**
|
||||||
// It specifies that this implementation applies exclusively
|
// It specifies that this implementation applies exclusively
|
||||||
// to types `T` that implement `Sized`
|
// to types `T` that implement `Sized`
|
||||||
// You can require multiple trait to be implemented using
|
// You can require multiple traits to be implemented using
|
||||||
// the `+` sign. E.g. `Sized + PartialEq<T>`
|
// the `+` sign. E.g. `Sized + PartialEq<T>`
|
||||||
{
|
{
|
||||||
inner: T,
|
inner: T,
|
||||||
|
|
|
@ -74,7 +74,7 @@ It uses both mechanisms:
|
||||||
### `RHS`
|
### `RHS`
|
||||||
|
|
||||||
`RHS` is a generic parameter to allow for different types to be added together.
|
`RHS` is a generic parameter to allow for different types to be added together.
|
||||||
For example, you'll find these two implementation in the standard library:
|
For example, you'll find these two implementations in the standard library:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
impl Add<u32> for u32 {
|
impl Add<u32> for u32 {
|
||||||
|
|
|
@ -23,7 +23,7 @@ impl Status {
|
||||||
```
|
```
|
||||||
|
|
||||||
A `match` statement that lets you compare a Rust value against a series of **patterns**.
|
A `match` statement that lets you compare a Rust value against a series of **patterns**.
|
||||||
You can think of it as a type-level `if`. If `status` is an `Done` variant, execute the first block;
|
You can think of it as a type-level `if`. If `status` is a `Done` variant, execute the first block;
|
||||||
if it's a `InProgress` or `ToDo` variant, execute the second block.
|
if it's a `InProgress` or `ToDo` variant, execute the second block.
|
||||||
|
|
||||||
## Exhaustiveness
|
## Exhaustiveness
|
||||||
|
|
Loading…
Reference in a new issue