Skip to content

Commit

Permalink
bump: v0.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Dec 13, 2023
1 parent b92d887 commit 28b3c25
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ members = [
]

[workspace.package]
version = "0.5.1"
version = "0.5.2"
authors = ["Fangdun Tsai <[email protected]>"]
edition = "2021"
homepage = "https://viz.rs"
Expand All @@ -45,10 +45,10 @@ license = "MIT"
rust-version = "1.63" # follows `tokio` and `hyper`

[workspace.dependencies]
viz = { version = "0.5.1", path = "viz" }
viz-core = { version = "0.5.1", path = "viz-core" }
viz-router = { version = "0.5.1", path = "viz-router" }
viz-handlers = { version = "0.5.1", path = "viz-handlers", default-features = false }
viz = { version = "0.5.2", path = "viz" }
viz-core = { version = "0.5.2", path = "viz-core" }
viz-router = { version = "0.5.2", path = "viz-router" }
viz-handlers = { version = "0.5.2", path = "viz-handlers", default-features = false }
viz-macros = { version = "0.1", path = "viz-macros" }
viz-test = { version = "0.1", path = "viz-test" }

Expand Down
1 change: 0 additions & 1 deletion viz-core/src/from_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ pub trait FromRequest: Sized {
type Error: IntoResponse;

/// Extracts this type from the HTTP [`Request`].
#[must_use]
async fn extract(req: &mut Request) -> Result<Self, Self::Error>;
}

Expand Down
3 changes: 1 addition & 2 deletions viz-core/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ pub trait Handler<Input>: dyn_clone::DynClone + Send + Sync + 'static {
type Output;

/// Performs the call operation.
#[must_use]
async fn call(&self, input: Input) -> Self::Output;
}

Expand All @@ -67,7 +66,7 @@ where

/// The [`HandlerExt`] trait, which provides adapters for chaining and composing handlers.
///
/// Likes the [`FutureExt`] and [`StreamExt`] trait.
/// Likes the [`FutureExt`] and [`StreamExt`] traits.
///
/// [`FutureExt`]: https://docs.rs/futures/latest/futures/future/trait.FutureExt.html
/// [`StreamExt`]: https://docs.rs/futures/latest/futures/stream/trait.StreamExt.html
Expand Down
9 changes: 3 additions & 6 deletions viz-core/src/request.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::mem::replace;

use crate::{
async_trait, header,
types::{PayloadError, RealIp},
Expand Down Expand Up @@ -37,7 +35,7 @@ use crate::types::Session;
#[cfg(feature = "params")]
use crate::types::{ParamsError, PathDeserializer, RouteInfo};

/// The [Request] Extension.
/// The [`Request`] Extension.
#[async_trait]
pub trait RequestExt: Sized {
/// Get URL's schema of this request.
Expand Down Expand Up @@ -255,7 +253,7 @@ impl RequestExt for Request {
}

fn incoming_body(&mut self) -> IncomingBody {
replace(self.body_mut(), IncomingBody::used())
std::mem::replace(self.body_mut(), IncomingBody::used())
}

fn incoming(&mut self) -> Result<Incoming, PayloadError> {
Expand All @@ -267,12 +265,11 @@ impl RequestExt for Request {
}

async fn bytes(&mut self) -> Result<Bytes, PayloadError> {
// self.body_mut()
self.incoming()?
.collect()
.await
.map_err(|_| PayloadError::Read)
.map(Collected::to_bytes)
.map_err(|_| PayloadError::Read)
}

#[cfg(feature = "limits")]
Expand Down

0 comments on commit 28b3c25

Please sign in to comment.