Skip to content

Commit

Permalink
refactor(marketprice): ok_or -> ok_or_else
Browse files Browse the repository at this point in the history
  • Loading branch information
KirilMihaylov authored and Gancho Manev committed May 25, 2023
1 parent 8c44be2 commit b29acb6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/marketprice/src/alarms/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,11 @@ where
.pop_front(self.storage.deref_mut())
.map_err(Into::into)
.and_then(|maybe_alarm: Option<AlarmWithSubscriber>| {
maybe_alarm.ok_or(AlarmError::EmptyAlarmsInDeliveryQueue(String::from(
"Received failure reply status",
)))
maybe_alarm.ok_or_else(|| {
AlarmError::EmptyAlarmsInDeliveryQueue(String::from(
"Received failure reply status",
))
})
})
.and_then(|alarm: AlarmWithSubscriber| {
Self::add_alarm_internal(
Expand Down

0 comments on commit b29acb6

Please sign in to comment.