1
0
mirror of https://github.com/actix/examples synced 2024-11-23 22:41:07 +01: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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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