From c47371caa70a8bc2551943b1786fd58c6d25e316 Mon Sep 17 00:00:00 2001 From: PeterPierinakos <101414157+PeterPierinakos@users.noreply.github.com> Date: Fri, 24 Jun 2022 17:17:52 +0000 Subject: [PATCH] Replace all unwraps in hello-world example with ? operator (#562) --- basics/hello-world/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basics/hello-world/src/main.rs b/basics/hello-world/src/main.rs index e38da712..d76dc5ac 100644 --- a/basics/hello-world/src/main.rs +++ b/basics/hello-world/src/main.rs @@ -35,12 +35,12 @@ mod tests { let app = test::init_service(app).await; let req = test::TestRequest::get().uri("/").to_request(); - let resp = app.call(req).await.unwrap(); + let resp = app.call(req).await?; assert_eq!(resp.status(), http::StatusCode::OK); let response_body = resp.into_body(); - assert_eq!(to_bytes(response_body).await.unwrap(), r##"Hello world!"##); + assert_eq!(to_bytes(response_body).await?, r##"Hello world!"##); Ok(()) }