Skip to content

Commit 192ac87

Browse files
Added @davidtwco suggestions
Co-authored-by: David Wood <[email protected]>
1 parent 9f6497c commit 192ac87

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

posts/inside-rust/2019-10-11-AsyncAwait-Not-Send-Error-Improvements.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,25 +121,20 @@ async fn bar(x: &Mutex<u32>) {
121121
```
122122

123123
```rust
124-
enum BarAsyncFnGenerator {
125-
Unresumed {
126-
// async fn params
127-
x: &Mutex<u32>,
128-
},
124+
enum BarGenerator {
125+
// `bar`'s parameters.
126+
Unresumed { x: &Mutex<u32> },
129127

130128
Suspend0 {
131-
// future being polled: baz_fut = baz()
132-
baz_fut: BazAsyncFnGenerator,
129+
// Future returned by `baz`, which is being polled.
130+
baz_future: BazGenerator,
133131

134-
// locals that cross the await point
132+
// Locals that are used across the await point.
135133
x: &Mutex<u32>,
136134
g: MutexGuard<'_, u32>,
137135
},
138136

139-
Return(
140-
// value returned by the future
141-
()
142-
)
137+
Returned { value: () }
143138
}
144139
```
145140

0 commit comments

Comments
 (0)