Skip to content

Commit 3138a0e

Browse files
committed
clippy: document unsafe pin projection
1 parent 33e99c5 commit 3138a0e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

http-body/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ impl<B: Body> Body for http::Request<B> {
141141
self: Pin<&mut Self>,
142142
cx: &mut Context<'_>,
143143
) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>> {
144+
// SAFETY:
145+
// A pin projection.
144146
unsafe {
145147
self.map_unchecked_mut(http::Request::body_mut)
146148
.poll_frame(cx)
@@ -164,6 +166,8 @@ impl<B: Body> Body for http::Response<B> {
164166
self: Pin<&mut Self>,
165167
cx: &mut Context<'_>,
166168
) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>> {
169+
// SAFETY:
170+
// A pin projection.
167171
unsafe {
168172
self.map_unchecked_mut(http::Response::body_mut)
169173
.poll_frame(cx)

0 commit comments

Comments
 (0)