Fix up tests
This commit is contained in:
@@ -242,7 +242,7 @@ impl lb_tcpstream {
|
||||
}
|
||||
|
||||
fn read_half<'s>(&'s self) -> Result<RefMut<'s, OwnedReadHalf>> {
|
||||
let read = self.read.borrow_mut();
|
||||
let read = self.read.try_borrow_mut()?;
|
||||
match *read {
|
||||
Some(_) => Ok(RefMut::map(read, |s| s.as_mut().unwrap())),
|
||||
None => Err(Error::SocketClosed),
|
||||
@@ -250,7 +250,7 @@ impl lb_tcpstream {
|
||||
}
|
||||
|
||||
fn write_half<'s>(&'s self) -> Result<RefMut<'s, OwnedWriteHalf>> {
|
||||
let write = self.write.borrow_mut();
|
||||
let write = self.write.try_borrow_mut()?;
|
||||
match *write {
|
||||
Some(_) => Ok(RefMut::map(write, |s| s.as_mut().unwrap())),
|
||||
None => Err(Error::SocketClosed),
|
||||
|
||||
Reference in New Issue
Block a user