mirror of
https://github.com/tokio-rs/axum.git
synced 2024-11-21 22:56:46 +01:00
Resolve clippies (#2843)
This commit is contained in:
parent
37e4574012
commit
50274725cb
8 changed files with 3 additions and 23 deletions
|
@ -30,6 +30,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
// some extractor that requires the state, such as `SignedCookieJar`
|
// some extractor that requires the state, such as `SignedCookieJar`
|
||||||
|
#[allow(dead_code)]
|
||||||
pub(crate) struct RequiresState(pub(crate) String);
|
pub(crate) struct RequiresState(pub(crate) String);
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
clippy::needless_borrow,
|
clippy::needless_borrow,
|
||||||
clippy::match_wildcard_for_single_variants,
|
clippy::match_wildcard_for_single_variants,
|
||||||
clippy::if_let_mutex,
|
clippy::if_let_mutex,
|
||||||
clippy::mismatched_target_os,
|
|
||||||
clippy::await_holding_lock,
|
clippy::await_holding_lock,
|
||||||
clippy::match_on_vec_items,
|
clippy::match_on_vec_items,
|
||||||
clippy::imprecise_flops,
|
clippy::imprecise_flops,
|
||||||
|
|
|
@ -49,7 +49,7 @@ http-body-util = "0.1.0"
|
||||||
mime = "0.3"
|
mime = "0.3"
|
||||||
pin-project-lite = "0.2"
|
pin-project-lite = "0.2"
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
tower = { version = "0.4", default_features = false, features = ["util"] }
|
tower = { version = "0.4", default-features = false, features = ["util"] }
|
||||||
tower-layer = "0.3"
|
tower-layer = "0.3"
|
||||||
tower-service = "0.3"
|
tower-service = "0.3"
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@
|
||||||
clippy::needless_borrow,
|
clippy::needless_borrow,
|
||||||
clippy::match_wildcard_for_single_variants,
|
clippy::match_wildcard_for_single_variants,
|
||||||
clippy::if_let_mutex,
|
clippy::if_let_mutex,
|
||||||
clippy::mismatched_target_os,
|
|
||||||
clippy::await_holding_lock,
|
clippy::await_holding_lock,
|
||||||
clippy::match_on_vec_items,
|
clippy::match_on_vec_items,
|
||||||
clippy::imprecise_flops,
|
clippy::imprecise_flops,
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
clippy::needless_borrow,
|
clippy::needless_borrow,
|
||||||
clippy::match_wildcard_for_single_variants,
|
clippy::match_wildcard_for_single_variants,
|
||||||
clippy::if_let_mutex,
|
clippy::if_let_mutex,
|
||||||
clippy::mismatched_target_os,
|
|
||||||
clippy::await_holding_lock,
|
clippy::await_holding_lock,
|
||||||
clippy::match_on_vec_items,
|
clippy::match_on_vec_items,
|
||||||
clippy::imprecise_flops,
|
clippy::imprecise_flops,
|
||||||
|
|
|
@ -388,7 +388,6 @@
|
||||||
clippy::needless_borrow,
|
clippy::needless_borrow,
|
||||||
clippy::match_wildcard_for_single_variants,
|
clippy::match_wildcard_for_single_variants,
|
||||||
clippy::if_let_mutex,
|
clippy::if_let_mutex,
|
||||||
clippy::mismatched_target_os,
|
|
||||||
clippy::await_holding_lock,
|
clippy::await_holding_lock,
|
||||||
clippy::match_on_vec_items,
|
clippy::match_on_vec_items,
|
||||||
clippy::imprecise_flops,
|
clippy::imprecise_flops,
|
||||||
|
|
|
@ -12,23 +12,6 @@ fn timeout() -> TimeoutLayer {
|
||||||
TimeoutLayer::new(Duration::from_millis(10))
|
TimeoutLayer::new(Duration::from_millis(10))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
|
||||||
struct Svc;
|
|
||||||
|
|
||||||
impl<R> Service<R> for Svc {
|
|
||||||
type Response = Response<Body>;
|
|
||||||
type Error = hyper::Error;
|
|
||||||
type Future = Ready<Result<Self::Response, Self::Error>>;
|
|
||||||
|
|
||||||
fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
|
||||||
Poll::Ready(Ok(()))
|
|
||||||
}
|
|
||||||
|
|
||||||
fn call(&mut self, _req: R) -> Self::Future {
|
|
||||||
ready(Ok(Response::new(Body::empty())))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[crate::test]
|
#[crate::test]
|
||||||
async fn handler() {
|
async fn handler() {
|
||||||
let app = Router::new().route(
|
let app = Router::new().route(
|
||||||
|
|
|
@ -96,7 +96,7 @@ mod tests {
|
||||||
let listening_url = spawn_app("127.0.0.1").await;
|
let listening_url = spawn_app("127.0.0.1").await;
|
||||||
|
|
||||||
let mut event_stream = reqwest::Client::new()
|
let mut event_stream = reqwest::Client::new()
|
||||||
.get(&format!("{}/sse", listening_url))
|
.get(format!("{}/sse", listening_url))
|
||||||
.header("User-Agent", "integration_test")
|
.header("User-Agent", "integration_test")
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
|
|
Loading…
Reference in a new issue