diff --git a/actix-web-lab/CHANGELOG.md b/actix-web-lab/CHANGELOG.md index 47b14bd8..85ec9d2f 100644 --- a/actix-web-lab/CHANGELOG.md +++ b/actix-web-lab/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - Add `sse::Data::{retry, set_retry}` methods to set the connection's reconnection delay in individual data messages. +- Deprecate `body::{new_infallible_body_stream, new_infallible_sized_stream}` in favor of the upstream `actix_web::body::{BodyStream, SizedStream}::from_infallible()` constructors. ## 0.29.5 diff --git a/actix-web-lab/src/body.rs b/actix-web-lab/src/body.rs index 459d182a..ebae4e91 100644 --- a/actix-web-lab/src/body.rs +++ b/actix-web-lab/src/body.rs @@ -2,8 +2,9 @@ //! //! Analogous to the `body` module in Actix Web. +#[expect(deprecated)] +pub use crate::infallible_body_stream::{new_infallible_body_stream, new_infallible_sized_stream}; pub use crate::{ body_async_write::{Writer, writer}, body_channel::{Sender, channel}, - infallible_body_stream::{new_infallible_body_stream, new_infallible_sized_stream}, }; diff --git a/actix-web-lab/src/infallible_body_stream.rs b/actix-web-lab/src/infallible_body_stream.rs index e4b35d4c..d639e556 100644 --- a/actix-web-lab/src/infallible_body_stream.rs +++ b/actix-web-lab/src/infallible_body_stream.rs @@ -6,7 +6,11 @@ use crate::util::InfallibleStream; /// Constructs a new [`BodyStream`] from an infallible byte chunk stream. /// -/// This could be stabilized into Actix Web as `BodyStream::from_infallible()`. +/// Use the upstream `actix_web::body::BodyStream::from_infallible()` constructor instead. +#[deprecated( + since = "0.29.6", + note = "Use the upstream `actix_web::body::BodyStream::from_infallible()` constructor instead." +)] pub fn new_infallible_body_stream>( stream: S, ) -> BodyStream> { @@ -15,7 +19,11 @@ pub fn new_infallible_body_stream>( /// Constructs a new [`SizedStream`] from an infallible byte chunk stream. /// -/// This could be stabilized into Actix Web as `SizedStream::from_infallible()`. +/// Use the upstream `actix_web::body::SizedStream::from_infallible()` constructor instead. +#[deprecated( + since = "0.29.6", + note = "Use the upstream `actix_web::body::SizedStream::from_infallible()` constructor instead." +)] pub fn new_infallible_sized_stream>( size: u64, stream: S,