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 13, 2023
1 parent c390a62 commit 4072237
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 @@ -75,7 +75,10 @@ impl<T> ReadHalf<T> {
/// This can be checked ahead of time by comparing the stream ID
/// of the two halves.
#[track_caller]
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 4072237

Please sign in to comment.