Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add watch #1

Merged
merged 2 commits into from
Jan 25, 2021
Merged

add watch #1

merged 2 commits into from
Jan 25, 2021

Conversation

liufuyang
Copy link
Owner

I tried to add watch the same way as the broadcast side, but now I ended up with an error like this:

warning: variable does not need to be mutable
  --> tokio-stream/src/wrappers/watch.rs:40:18
   |
40 |     fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
   |                  ----^^^^
   |                  |
   |                  help: remove this `mut`
   |
   = note: `#[warn(unused_mut)]` on by default

error[E0596]: cannot borrow data in a dereference of `Pin<&mut WatchStream<T>>` as mutable
  --> tokio-stream/src/wrappers/watch.rs:41:18
   |
41 |         Pin::new(&mut self.inner).poll_next(cx)
   |                  ^^^^^^^^^^^^^^^ cannot borrow as mutable
   |
   = help: trait `DerefMut` is required to modify through a dereference, but it is not implemented for `Pin<&mut WatchStream<T>>`

error: aborting due to previous error; 2 warnings emitted

Hopefully you can give a hand here? :)

@liufuyang liufuyang merged commit ff23c5a into tokio-stream-3382 Jan 25, 2021
@liufuyang liufuyang deleted the tokio-stream-3382-watch branch January 25, 2021 10:10
liufuyang added a commit that referenced this pull request Jan 31, 2021
* add watch

* Fix up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant