Skip to content
Open
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
12 changes: 4 additions & 8 deletions content/tokio/tutorial/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,14 +644,10 @@ The logic we want to implement is:

```rust
async fn action(input: Option<i32>) -> Option<String> {
// If the input is `None`, return `None`.
// This could also be written as `let i = input?;`
let i = match input {
Some(input) => input,
None => return None,
};
// async logic here
# Some(i.to_string())
input.map(|i| {
// async logic here
# i.to_string()
})
}

#[tokio::main]
Expand Down
Loading