A few small refactorings (#655)

* Simplify json content-type check

* Import HeaderMap from http instead of from headers

The headers crate is an optional dependency and its HeaderMap re-export
is `#[doc(hidden)]`.

* Use headers re-export in axum in examples
This commit is contained in:
Jonas Platte
2021-12-27 14:02:38 +01:00
committed by GitHub
parent f4716084a7
commit 0a399ed0fa
5 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -9,12 +9,12 @@
use axum::{
async_trait,
extract::{FromRequest, RequestParts, TypedHeader},
headers::{authorization::Bearer, Authorization},
http::StatusCode,
response::{IntoResponse, Response},
routing::{get, post},
Json, Router,
};
use headers::{authorization::Bearer, Authorization};
use jsonwebtoken::{decode, encode, DecodingKey, EncodingKey, Header, Validation};
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};