examples: Simplify Request and Response construction (#3653)

This commit is contained in:
tottoto
2026-02-11 09:08:22 +01:00
committed by GitHub
parent 57e2455905
commit 3f8956dcd0
8 changed files with 20 additions and 64 deletions
+1 -6
View File
@@ -81,12 +81,7 @@ mod tests {
#[tokio::test]
async fn test_main() {
let response = app()
.oneshot(
Request::builder()
.uri("/greet/Foo")
.body(Body::empty())
.unwrap(),
)
.oneshot(Request::get("/greet/Foo").body(Body::empty()).unwrap())
.await
.unwrap();
assert_eq!(response.status(), StatusCode::OK);