Skip to content

Commit

Permalink
clippy: document unsafe pin projection
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Nov 15, 2023
1 parent 33e99c5 commit 3138a0e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions http-body/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ impl<B: Body> Body for http::Request<B> {
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>> {
// SAFETY:
// A pin projection.
unsafe {
self.map_unchecked_mut(http::Request::body_mut)
.poll_frame(cx)
Expand All @@ -164,6 +166,8 @@ impl<B: Body> Body for http::Response<B> {
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>> {
// SAFETY:
// A pin projection.
unsafe {
self.map_unchecked_mut(http::Response::body_mut)
.poll_frame(cx)
Expand Down

0 comments on commit 3138a0e

Please sign in to comment.