diff --git a/src/json.rs b/src/json.rs index 1c99b774..1ad4a7be 100644 --- a/src/json.rs +++ b/src/json.rs @@ -33,8 +33,6 @@ use std::ops::{Deref, DerefMut}; /// /// async fn create_user(extract::Json(payload): extract::Json) { /// // payload is a `CreateUser` -/// -/// // ... /// } /// /// let app = route("/users", post(create_user)); @@ -59,12 +57,18 @@ use std::ops::{Deref, DerefMut}; /// /// #[derive(Serialize)] /// struct User { -/// name: String, -/// email: String, +/// id: Uuid, +/// username: String, /// } /// /// async fn get_user(Path(user_id) : Path) -> Json { -/// todo!() +/// let user = find_user(user_id).await; +/// Json(user) +/// } +/// +/// async fn find_user(user_id: Uuid) -> User { +/// // ... +/// # unimplemented!() /// } /// /// let app = route("/users/:id", get(get_user));