File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ impl Stdin {
146
146
/// accessing the underlying data.
147
147
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
148
148
pub fn lock ( & self ) -> StdinLock {
149
- StdinLock { inner : self . inner . lock ( ) . unwrap ( ) }
149
+ StdinLock { inner : self . inner . lock ( ) . unwrap_or_else ( |e| e . into_inner ( ) ) }
150
150
}
151
151
152
152
/// Locks this handle and reads a line of input into the specified buffer.
@@ -249,7 +249,7 @@ impl Stdout {
249
249
/// returned guard also implements the `Write` trait for writing data.
250
250
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
251
251
pub fn lock ( & self ) -> StdoutLock {
252
- StdoutLock { inner : self . inner . lock ( ) . unwrap ( ) }
252
+ StdoutLock { inner : self . inner . lock ( ) . unwrap_or_else ( |e| e . into_inner ( ) ) }
253
253
}
254
254
}
255
255
@@ -319,7 +319,7 @@ impl Stderr {
319
319
/// returned guard also implements the `Write` trait for writing data.
320
320
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
321
321
pub fn lock ( & self ) -> StderrLock {
322
- StderrLock { inner : self . inner . lock ( ) . unwrap ( ) }
322
+ StderrLock { inner : self . inner . lock ( ) . unwrap_or_else ( |e| e . into_inner ( ) ) }
323
323
}
324
324
}
325
325
You can’t perform that action at this time.
0 commit comments