This commit is contained in:
David Pedersen
2022-11-23 18:43:42 +01:00
parent 459181f569
commit e85538b047
15 changed files with 271 additions and 630 deletions
+3 -3
View File
@@ -147,7 +147,7 @@ impl<B> From<Resource<B>> for Router<B> {
mod tests {
#[allow(unused_imports)]
use super::*;
use axum::{extract::Path, http::Method, routing::RouterService, Router};
use axum::{extract::Path, http::Method, Router};
use http::Request;
use tower::{Service, ServiceExt};
@@ -162,7 +162,7 @@ mod tests {
.update(|Path(id): Path<u64>| async move { format!("users#update id={}", id) })
.destroy(|Path(id): Path<u64>| async move { format!("users#destroy id={}", id) });
let mut app = Router::new().merge(users).into_service();
let mut app = Router::new().merge(users);
assert_eq!(
call_route(&mut app, Method::GET, "/users").await,
@@ -205,7 +205,7 @@ mod tests {
);
}
async fn call_route(app: &mut RouterService, method: Method, uri: &str) -> String {
async fn call_route(app: &mut Router, method: Method, uri: &str) -> String {
let res = app
.ready()
.await
+1 -1
View File
@@ -270,7 +270,7 @@ mod tests {
#[allow(dead_code)]
fn works_with_router_with_state() {
let _: axum::RouterService = Router::new()
let _: Router = Router::new()
.merge(SpaRouter::new("/assets", "test_files"))
.route("/", get(|_: axum::extract::State<String>| async {}))
.with_state(String::new());