1
0
mirror of https://github.com/actix/examples synced 2025-06-28 09:50:36 +02:00
This commit is contained in:
Rob Ede
2021-10-07 03:04:59 +01:00
parent bfede4c1bb
commit e60e7810de
9 changed files with 18 additions and 18 deletions

View File

@ -40,10 +40,10 @@ async fn cache_stuff(
.collect();
// successful operations return "OK", so confirm that all returned as so
if !res.iter().all(|res| match res {
Ok(RespValue::SimpleString(x)) if x == "OK" => true,
_ => false,
}) {
if !res
.iter()
.all(|res| matches!(res,Ok(RespValue::SimpleString(x)) if x == "OK"))
{
Ok(HttpResponse::InternalServerError().finish())
} else {
Ok(HttpResponse::Ok().body("successfully cached values"))