Skip to content

Commit

Permalink
refactor: use unwrap_or_else instead of if let
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed May 22, 2024
1 parent 187a449 commit 9ae60c5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/rs-drive-abci/src/abci/handler/check_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,10 @@ where
.cloned()
.unwrap_or_default();

let state_transition_name =
if let Some(ref name) = check_tx_result.state_transition_name {
name.to_owned()
} else {
"Unknown".to_string()
};
let state_transition_name = check_tx_result
.state_transition_name
.clone()
.unwrap_or_else(|| "Unknown".to_string());

let priority = check_tx_result.priority as i64;

Expand Down

0 comments on commit 9ae60c5

Please sign in to comment.