mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-20 00:00:11 +02:00
move imports under the feature (#3578)
This commit is contained in:
@@ -384,12 +384,7 @@ impl_second_element_is!(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::routing::{RouterExt, TypedPath};
|
use crate::routing::TypedPath;
|
||||||
use axum::{
|
|
||||||
extract::rejection::PathRejection,
|
|
||||||
response::{IntoResponse, Response},
|
|
||||||
Router,
|
|
||||||
};
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(TypedPath, Deserialize)]
|
#[derive(TypedPath, Deserialize)]
|
||||||
@@ -441,6 +436,12 @@ mod tests {
|
|||||||
#[cfg(feature = "with-rejection")]
|
#[cfg(feature = "with-rejection")]
|
||||||
#[allow(dead_code)] // just needs to compile
|
#[allow(dead_code)] // just needs to compile
|
||||||
fn supports_with_rejection() {
|
fn supports_with_rejection() {
|
||||||
|
use crate::routing::RouterExt;
|
||||||
|
use axum::{
|
||||||
|
extract::rejection::PathRejection,
|
||||||
|
response::{IntoResponse, Response},
|
||||||
|
Router,
|
||||||
|
};
|
||||||
async fn handler(_: crate::extract::WithRejection<UsersShow, MyRejection>) {}
|
async fn handler(_: crate::extract::WithRejection<UsersShow, MyRejection>) {}
|
||||||
|
|
||||||
struct MyRejection {}
|
struct MyRejection {}
|
||||||
|
|||||||
Reference in New Issue
Block a user