fix: s/ok_or/ok_or_else in relevant places

Signed-off-by: girlbossceo <june@girlboss.ceo>
This commit is contained in:
girlbossceo 2023-07-29 19:17:12 +00:00
parent 2b4a6c96ee
commit e2c914cc11
4 changed files with 13 additions and 9 deletions

View file

@ -953,7 +953,7 @@ pub async fn get_event_route(
.rooms
.timeline
.get_pdu_json(&body.event_id)?
.ok_or({
.ok_or_else(|| {
warn!("Event not found, event ID: {:?}", &body.event_id);
Error::BadRequest(ErrorKind::NotFound, "Event not found.")
})?;
@ -1196,7 +1196,7 @@ pub async fn get_event_authorization_route(
.rooms
.timeline
.get_pdu_json(&body.event_id)?
.ok_or({
.ok_or_else(|| {
warn!("Event not found, event ID: {:?}", &body.event_id);
Error::BadRequest(ErrorKind::NotFound, "Event not found.")
})?;