You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-15 22:00:26 +02:00
Simplify async channel example
This removes a nested import (which I find hard to read) and removes an unnecessary type annotation.
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
use tokio::sync::mpsc::{self, Receiver};
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
async fn ping_handler(mut input: Receiver<()>) {
|
||||
let mut count: usize = 0;
|
||||
async fn ping_handler(mut input: mpsc::Receiver<()>) {
|
||||
let mut count = 0;
|
||||
|
||||
while let Some(_) = input.recv().await {
|
||||
count += 1;
|
||||
|
Reference in New Issue
Block a user