mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-28 12:10:37 +00:00
docs: fix indent of tokio::sync::watch
example code (#4922)
This commit is contained in:
parent
4b1c4801b1
commit
de81985762
@ -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(())
|
||||
//! # }
|
||||
//! ```
|
||||
|
Loading…
x
Reference in New Issue
Block a user