mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
tokio-sync: add into_inner for TrySendErrors (#862)
This commit is contained in:
committed by
Carl Lerche
parent
13083153aa
commit
9f356d6244
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user