File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,16 @@ pub enum TrySendError<T> {
36
36
Closed ( T ) ,
37
37
}
38
38
39
+ impl < T > TrySendError < T > {
40
+ /// Consume the `TrySendError`, returning the unsent value.
41
+ pub fn into_inner ( self ) -> T {
42
+ match self {
43
+ TrySendError :: Full ( val) => val,
44
+ TrySendError :: Closed ( val) => val,
45
+ }
46
+ }
47
+ }
48
+
39
49
impl < T > fmt:: Debug for TrySendError < T > {
40
50
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
41
51
match * self {
@@ -123,6 +133,16 @@ cfg_time! {
123
133
Closed ( T ) ,
124
134
}
125
135
136
+ impl <T > SendTimeoutError <T > {
137
+ /// Consume the `SendTimeoutError`, returning the unsent value.
138
+ pub fn into_inner( self ) -> T {
139
+ match self {
140
+ SendTimeoutError :: Timeout ( val) => val,
141
+ SendTimeoutError :: Closed ( val) => val,
142
+ }
143
+ }
144
+ }
145
+
126
146
impl <T > fmt:: Debug for SendTimeoutError <T > {
127
147
fn fmt( & self , f: & mut fmt:: Formatter <' _>) -> fmt:: Result {
128
148
match * self {
You can’t perform that action at this time.
0 commit comments