1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-06-02 21:39:26 +00:00

use anybody in doc test

This commit is contained in:
Rob Ede 2021-11-21 23:34:58 +00:00
parent dd347e0bd0
commit a2a42ec152
No known key found for this signature in database
GPG key ID: 97C636207D3EF933

View file

@ -28,15 +28,15 @@ pub use self::sized_stream::SizedStream;
///
/// # Examples
/// ```
/// use actix_http::body::{Body, to_bytes};
/// use actix_http::body::{AnyBody, to_bytes};
/// use bytes::Bytes;
///
/// # async fn test_to_bytes() {
/// let body = Body::None;
/// let body = AnyBody::None;
/// let bytes = to_bytes(body).await.unwrap();
/// assert!(bytes.is_empty());
///
/// let body = Body::Bytes(Bytes::from_static(b"123"));
/// let body = AnyBody::Bytes(Bytes::from_static(b"123"));
/// let bytes = to_bytes(body).await.unwrap();
/// assert_eq!(bytes, b"123"[..]);
/// # }