Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions content/writeups/pin-is-neccesary.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ draft = false
So, let's say you have a clean and nice function like this.

```rs
use std::future::poll_fn;
use std::pin::Pin;
async fn foo() -> u32 {
let mut x = 1;
Expand All @@ -20,7 +19,7 @@ async fn foo() -> u32 {
#[tokio::main]
async fn main() {
let mut x = foo();
let mut a = unsafe { Pin::new_unchecked(&mut x) };
let a = unsafe { Pin::new_unchecked(&mut x) };

println!("{}", a.await);
}
Expand Down