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 Clone to RecvError types #4560

Merged
merged 1 commit into from Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion tokio-stream/src/wrappers/broadcast.rs
Expand Up @@ -18,7 +18,7 @@ pub struct BroadcastStream<T> {
}

/// An error returned from the inner stream of a [`BroadcastStream`].
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Clone)]
pub enum BroadcastStreamRecvError {
/// The receiver lagged too far behind. Attempting to receive again will
/// return the oldest message still retained by the channel.
Expand Down
4 changes: 2 additions & 2 deletions tokio/src/sync/broadcast.rs
Expand Up @@ -230,7 +230,7 @@ pub mod error {
///
/// [`recv`]: crate::sync::broadcast::Receiver::recv
/// [`Receiver`]: crate::sync::broadcast::Receiver
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Clone)]
pub enum RecvError {
/// There are no more active senders implying no further messages will ever
/// be sent.
Expand Down Expand Up @@ -258,7 +258,7 @@ pub mod error {
///
/// [`try_recv`]: crate::sync::broadcast::Receiver::try_recv
/// [`Receiver`]: crate::sync::broadcast::Receiver
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Clone)]
pub enum TryRecvError {
/// The channel is currently empty. There are still active
/// [`Sender`] handles, so data may yet become available.
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/sync/mpsc/error.rs
Expand Up @@ -78,7 +78,7 @@ impl Error for TryRecvError {}
// ===== RecvError =====

/// Error returned by `Receiver`.
#[derive(Debug)]
#[derive(Debug, Clone)]
#[doc(hidden)]
#[deprecated(note = "This type is unused because recv returns an Option.")]
pub struct RecvError(());
Expand Down
4 changes: 2 additions & 2 deletions tokio/src/sync/oneshot.rs
Expand Up @@ -323,11 +323,11 @@ pub mod error {
use std::fmt;

/// Error returned by the `Future` implementation for `Receiver`.
#[derive(Debug, Eq, PartialEq)]
#[derive(Debug, Eq, PartialEq, Clone)]
pub struct RecvError(pub(super) ());

/// Error returned by the `try_recv` function on `Receiver`.
#[derive(Debug, Eq, PartialEq)]
#[derive(Debug, Eq, PartialEq, Clone)]
pub enum TryRecvError {
/// The send half of the channel has not yet sent a value.
Empty,
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/sync/watch.rs
Expand Up @@ -155,7 +155,7 @@ pub mod error {
impl<T: fmt::Debug> std::error::Error for SendError<T> {}

/// Error produced when receiving a change notification.
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct RecvError(pub(super) ());

// ===== impl RecvError =====
Expand Down