Add T: Unpin bound to ReadHalf::unsplit

This commit is contained in:
Taiki Endo
2023-01-17 21:53:54 +09:00
parent 9241c3eddf
commit d6ea7a742b
+4 -1
View File
@@ -74,7 +74,10 @@ impl<T> ReadHalf<T> {
/// same `split` operation this method will panic.
/// This can be checked ahead of time by comparing the stream ID
/// of the two halves.
pub fn unsplit(self, wr: WriteHalf<T>) -> T {
pub fn unsplit(self, wr: WriteHalf<T>) -> T
where
T: Unpin,
{
if self.is_pair_of(&wr) {
drop(wr);