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:
parent
04e3ccaca5
commit
c47371caa7
@ -35,12 +35,12 @@ mod tests {
|
|||||||
let app = test::init_service(app).await;
|
let app = test::init_service(app).await;
|
||||||
|
|
||||||
let req = test::TestRequest::get().uri("/").to_request();
|
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);
|
assert_eq!(resp.status(), http::StatusCode::OK);
|
||||||
|
|
||||||
let response_body = resp.into_body();
|
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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user