From 26f0d20ad64525a0986b3d7468732eb5ee708cd5 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Wed, 15 Nov 2023 11:16:26 -0500 Subject: [PATCH] clippy: document unsafe pin projection --- http-body/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/http-body/src/lib.rs b/http-body/src/lib.rs index 81acdaa..12077a2 100644 --- a/http-body/src/lib.rs +++ b/http-body/src/lib.rs @@ -141,6 +141,8 @@ impl Body for http::Request { self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll, Self::Error>>> { + // SAFETY: + // A pin projection. unsafe { self.map_unchecked_mut(http::Request::body_mut) .poll_frame(cx) @@ -164,6 +166,8 @@ impl Body for http::Response { self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll, Self::Error>>> { + // SAFETY: + // A pin projection. unsafe { self.map_unchecked_mut(http::Response::body_mut) .poll_frame(cx)