Skip to content

Commit 5c6632a

Browse files
author
Ivo Georgiev
committed
sentry_interface: remove an array indexing
1 parent c3a39d8 commit 5c6632a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

validator_worker/src/sentry_interface.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,8 @@ impl<T: Adapter + 'static> SentryApi<T> {
107107
.and_then(|mut res: Response| res.json::<ValidatorMessageResponse>())
108108
.compat()
109109
.await?;
110-
if !result.validator_messages.is_empty() {
111-
return Ok(Some(result.validator_messages[0].msg.clone()));
112-
}
113110

114-
Ok(None)
111+
Ok(result.validator_messages.get(0).map(|m| m.msg.clone()))
115112
}
116113

117114
pub async fn get_our_latest_msg(

0 commit comments

Comments
 (0)