From ac4262388b788620a79da9ed2f477e88833d4b8d Mon Sep 17 00:00:00 2001 From: Fangdun Tsai Date: Thu, 14 Dec 2023 17:59:41 +0800 Subject: [PATCH] chore(core): improve docs --- viz-core/src/from_request.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/viz-core/src/from_request.rs b/viz-core/src/from_request.rs index 9d6d29e1..32f26c48 100644 --- a/viz-core/src/from_request.rs +++ b/viz-core/src/from_request.rs @@ -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}; @@ -19,9 +17,8 @@ impl FromRequest for Option where T: FromRequest, { - type Error = Infallible; + type Error = std::convert::Infallible; - #[inline] async fn extract(req: &mut Request) -> Result { Ok(T::extract(req).await.ok()) } @@ -32,9 +29,8 @@ impl FromRequest for Result where T: FromRequest, { - type Error = Infallible; + type Error = std::convert::Infallible; - #[inline] async fn extract(req: &mut Request) -> Result { Ok(T::extract(req).await) }