Skip to content

Commit

Permalink
Add T: Unpin bound to ReadHalf::unsplit
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 17, 2023
1 parent 9241c3e commit d6ea7a7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tokio/src/io/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit d6ea7a7

Please sign in to comment.