Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
sharma-shray authored Sep 29, 2024
1 parent 4619245 commit 505ea06
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tokio-util/src/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ impl<T: tokio::io::AsyncSeek> futures_io::AsyncSeek for Compat<T> {
*self.as_mut().project().seek_pos = Some(pos);
}
let res = ready!(self.as_mut().project().inner.poll_complete(cx));
*self.as_mut().project().seek_pos = None;
if res.is_ok() {
*self.as_mut().project().seek_pos = None;
}
Poll::Ready(res)
}
}
Expand All @@ -254,7 +256,7 @@ impl<T: futures_io::AsyncSeek> tokio::io::AsyncSeek for Compat<T> {
}
Some(pos) => pos,
};
let res = ready!(self.as_mut().project().inner.poll_complete(cx));
let res = ready!(self.as_mut().project().inner.poll_seek(cx, pos));
if res.is_ok() {
*self.as_mut().project().seek_pos = None;
}
Expand Down

0 comments on commit 505ea06

Please sign in to comment.