1
0
mirror of https://github.com/actix/examples synced 2025-06-26 09:17:41 +02:00

Replace all unwraps in hello-world example with ? operator (#562)

This commit is contained in:
PeterPierinakos
2022-06-24 17:17:52 +00:00
committed by GitHub
parent 04e3ccaca5
commit c47371caa7

View File

@ -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(())
}