mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Fix typo
This commit is contained in:
@@ -385,7 +385,7 @@ impl Future for ExampleStateMachine {
|
|||||||
|
|
||||||
The `Output` type of the future is `String` because it's the return type of the `example` function. To implement the `poll` function, we use a match statement on the current state inside a `loop`. The idea is that we switch to the next state as long as possible and use an explicit `return Poll::Pending` when we can't continue.
|
The `Output` type of the future is `String` because it's the return type of the `example` function. To implement the `poll` function, we use a match statement on the current state inside a `loop`. The idea is that we switch to the next state as long as possible and use an explicit `return Poll::Pending` when we can't continue.
|
||||||
|
|
||||||
For simplicitly, we only show simplified code and don't handle [pinning][_pinning_], ownership, lifetimes, etc. So this and the following code should be treated as pseudo-code and not used directly. Of course, the real compiler-generated code handles everything correctly, albeit possibly in a different way.
|
For simplicity, we only show simplified code and don't handle [pinning][_pinning_], ownership, lifetimes, etc. So this and the following code should be treated as pseudo-code and not used directly. Of course, the real compiler-generated code handles everything correctly, albeit possibly in a different way.
|
||||||
|
|
||||||
To keep the code excerpts small, we present the code for each match arm separately. Let's begin with the `Start` state:
|
To keep the code excerpts small, we present the code for each match arm separately. Let's begin with the `Start` state:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user