docs: fix indent of tokio::sync::watch example code (#4922)

This commit is contained in:
Linda_pp 2022-08-18 23:12:58 +09:00 committed by GitHub
parent 4b1c4801b1
commit de81985762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,15 +20,15 @@
//! use tokio::sync::watch;
//!
//! # async fn dox() -> Result<(), Box<dyn std::error::Error>> {
//! let (tx, mut rx) = watch::channel("hello");
//! let (tx, mut rx) = watch::channel("hello");
//!
//! tokio::spawn(async move {
//! while rx.changed().await.is_ok() {
//! println!("received = {:?}", *rx.borrow());
//! }
//! });
//! tokio::spawn(async move {
//! while rx.changed().await.is_ok() {
//! println!("received = {:?}", *rx.borrow());
//! }
//! });
//!
//! tx.send("world")?;
//! tx.send("world")?;
//! # Ok(())
//! # }
//! ```