fix: s/ok_or/ok_or_else in relevant places
Signed-off-by: girlbossceo <june@girlboss.ceo>
This commit is contained in:
parent
2b4a6c96ee
commit
e2c914cc11
4 changed files with 13 additions and 9 deletions
|
@ -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.")
|
||||
})?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue