Skip to content

Commit

Permalink
feat: Relax Unpin bounds on io::copy
Browse files Browse the repository at this point in the history
This commit makes it so `!Unpin` types can be passed into `io::copy`.

Signed-off-by: John Nunley <[email protected]>
  • Loading branch information
notgull authored Jan 4, 2024
1 parent 85a3f0f commit 3b14c82
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ const DEFAULT_BUF_SIZE: usize = 8 * 1024;
/// ```
pub async fn copy<R, W>(reader: R, writer: W) -> Result<u64>
where
R: AsyncRead + Unpin,
W: AsyncWrite + Unpin,
R: AsyncRead,
W: AsyncWrite,
{
pin_project! {
struct CopyFuture<R, W> {
Expand All @@ -78,7 +78,7 @@ where
impl<R, W> Future for CopyFuture<R, W>
where
R: AsyncBufRead,
W: AsyncWrite + Unpin,
W: AsyncWrite,
{
type Output = Result<u64>;

Expand Down

0 comments on commit 3b14c82

Please sign in to comment.