Skip to content

Commit

Permalink
chore(core): improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Dec 14, 2023
1 parent aa60ad6 commit ac42623
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions viz-core/src/from_request.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
//! Extracts data from the [Request] by types.

use std::convert::Infallible;
//! Extracts data from the [`Request`] by types.

use crate::{async_trait, IntoResponse, Request};

Expand All @@ -19,9 +17,8 @@ impl<T> FromRequest for Option<T>
where
T: FromRequest,
{
type Error = Infallible;
type Error = std::convert::Infallible;

#[inline]
async fn extract(req: &mut Request) -> Result<Self, Self::Error> {
Ok(T::extract(req).await.ok())
}
Expand All @@ -32,9 +29,8 @@ impl<T> FromRequest for Result<T, T::Error>
where
T: FromRequest,
{
type Error = Infallible;
type Error = std::convert::Infallible;

#[inline]
async fn extract(req: &mut Request) -> Result<Self, Self::Error> {
Ok(T::extract(req).await)
}
Expand Down

0 comments on commit ac42623

Please sign in to comment.