Don't depend on axum-macros in examples (#2122)

This commit is contained in:
David Pedersen
2023-07-26 20:21:39 +02:00
committed by GitHub
parent 0151aeea54
commit f9ea40bb44
5 changed files with 11 additions and 12 deletions
@@ -1,4 +1,4 @@
//! Uses `axum_macros::FromRequest` to wrap another extractor and customize the
//! Uses `axum::extract::FromRequest` to wrap another extractor and customize the
//! rejection
//!
//! + Easy learning curve: Deriving `FromRequest` generates a `FromRequest`
@@ -11,8 +11,10 @@
//!
//! [`thiserror`]: https://crates.io/crates/thiserror
//! [FromRequest#known-limitations]: https://docs.rs/axum-macros/*/axum_macros/derive.FromRequest.html#known-limitations
use axum::{extract::rejection::JsonRejection, http::StatusCode, response::IntoResponse};
use axum_macros::FromRequest;
use axum::{
extract::rejection::JsonRejection, extract::FromRequest, http::StatusCode,
response::IntoResponse,
};
use serde_json::{json, Value};
pub async fn handler(Json(value): Json<Value>) -> impl IntoResponse {