From a171ae55d04b4273334e97b445bf12ad0ad58cbe Mon Sep 17 00:00:00 2001 From: Carl Fredrik Samson Date: Wed, 29 Jan 2020 02:35:02 +0100 Subject: [PATCH] test passes --- src/0_1_2_generators_pin.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/0_1_2_generators_pin.md b/src/0_1_2_generators_pin.md index fca607e..41cf2b8 100644 --- a/src/0_1_2_generators_pin.md +++ b/src/0_1_2_generators_pin.md @@ -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: -```rust +```rust, ignore async fn myfn() { let text = String::from("Hello world"); 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: -```rust,editable,compile_fail +```rust,editable use std::pin::Pin; use std::marker::PhantomPinned;