From 967297bdef61a9a28065397d368ef3ed811cc8e7 Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Sun, 13 Feb 2022 22:42:03 +0100 Subject: [PATCH] fix missing imports --- axum-extra/src/routing/typed.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/axum-extra/src/routing/typed.rs b/axum-extra/src/routing/typed.rs index 65a5efdd..9478e71c 100644 --- a/axum-extra/src/routing/typed.rs +++ b/axum-extra/src/routing/typed.rs @@ -9,10 +9,9 @@ use super::sealed::Sealed; /// /// ```rust /// use serde::Deserialize; -/// use axum_macros::TypedPath; /// use axum::{Router, extract::Json}; /// use axum_extra::routing::{ -/// typed, +/// TypedPath, /// RouterExt, // for `Router::typed_*` /// }; /// @@ -52,7 +51,7 @@ use super::sealed::Sealed; /// async fn users_create( /// _: UsersCollection, /// // Our handlers can accept other extractors. -/// Json(payload): Json, +/// Json(payload): Json, /// ) { /// // ... /// } @@ -68,8 +67,9 @@ use super::sealed::Sealed; /// While `TypedPath` can be implemented manually its _highly_ recommended to derive it: /// /// ``` -/// # use serde::Deserialize; -/// # +/// use serde::Deserialize; +/// use axum_extra::routing::TypedPath; +/// /// #[derive(TypedPath, Deserialize)] /// #[typed_path("/users/:id")] /// struct UsersMember { @@ -90,8 +90,9 @@ use super::sealed::Sealed; /// For example this fails to compile since the struct doesn't have a `team_id` field: /// /// ```compile_fail -/// # use serde::Deserialize; -/// # +/// use serde::Deserialize; +/// use axum_extra::routing::TypedPath; +/// /// #[derive(TypedPath, Deserialize)] /// #[typed_path("/users/:id/teams/:team_id")] /// struct UsersMember { @@ -102,8 +103,9 @@ use super::sealed::Sealed; /// Unit and tuple structs are also supported: /// /// ``` -/// # use serde::Deserialize; -/// # +/// use serde::Deserialize; +/// use axum_extra::routing::TypedPath; +/// /// #[derive(TypedPath)] /// #[typed_path("/users")] /// struct UsersCollection;