Skip to content

Commit

Permalink
fix docs code example
Browse files Browse the repository at this point in the history
  • Loading branch information
nicflower committed Sep 11, 2023
1 parent fed6789 commit edf2d61
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tokio/src/sync/watch.rs
Expand Up @@ -866,9 +866,9 @@ impl<T> Sender<T> {
/// # Examples
/// ```
/// let sender = tokio::sync::watch::Sender::new(0u8);
/// assert!(sender.send(3).is_err())
/// let _rec = sender.subscribe()
/// assert!(sender.send(4).is_ok())
/// assert!(sender.send(3).is_err());
/// let _rec = sender.subscribe();
/// assert!(sender.send(4).is_ok());
pub fn new(init: T) -> Self {
let (tx, _) = channel(init);
tx
Expand Down

0 comments on commit edf2d61

Please sign in to comment.