test passes

This commit is contained in:
Carl Fredrik Samson
2020-01-29 02:35:02 +01:00
parent 0ae614e392
commit a171ae55d0

View File

@@ -83,10 +83,12 @@ async/await as keywords (it can even be done using a macro).
The last point is in contrast to `Futures 1.0`. With async/await we can do this: The last point is in contrast to `Futures 1.0`. With async/await we can do this:
```rust ```rust, ignore
async fn myfn() { async fn myfn() {
let text = String::from("Hello world"); let text = String::from("Hello world");
let borrowed = &text[0..5]; let borrowed = &text[0..5];
somefuture.await;
println!("{}", borrowed);
} }
``` ```
@@ -585,7 +587,7 @@ Pin essentially prevents the **user** of your unsafe code
If we change the example to using `Pin` instead: If we change the example to using `Pin` instead:
```rust,editable,compile_fail ```rust,editable
use std::pin::Pin; use std::pin::Pin;
use std::marker::PhantomPinned; use std::marker::PhantomPinned;