Skip to content

Commit

Permalink
tokio-sync: add into_inner for TrySendErrors (tokio-rs#862)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar authored and carllerche committed Jan 22, 2019
1 parent 1308315 commit 9f356d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tokio-sync/src/mpsc/bounded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ impl ::std::error::Error for SendError {

// ===== impl TrySendError =====

impl<T> TrySendError<T> {
/// Get the inner value.
pub fn into_inner(self) -> T {
self.value
}
}

impl<T: fmt::Debug> fmt::Display for TrySendError<T> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
use std::error::Error;
Expand Down
7 changes: 7 additions & 0 deletions tokio-sync/src/mpsc/unbounded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ impl ::std::error::Error for UnboundedSendError {

// ===== impl TrySendError =====

impl<T> UnboundedTrySendError<T> {
/// Get the inner value.
pub fn into_inner(self) -> T {
self.0
}
}

impl<T: fmt::Debug> fmt::Display for UnboundedTrySendError<T> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
use std::error::Error;
Expand Down

0 comments on commit 9f356d6

Please sign in to comment.