tokio-sync: add into_inner for TrySendErrors (#862)

This commit is contained in:
Sean McArthur
2019-01-22 14:48:22 -08:00
committed by Carl Lerche
parent 13083153aa
commit 9f356d6244
2 changed files with 14 additions and 0 deletions
+7
View File
@@ -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;
+7
View File
@@ -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;