Skip to content

Commit

Permalink
fix clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ovstinga committed Jul 4, 2023
1 parent a30201d commit 27e617c
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions vm/src/tx_execution/system_sc/system_sc_issue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,16 @@ pub fn issue_non_fungible(tx_context: TxContext) -> (TxContext, TxResult) {
}

fn first_token_identifier_with_ticker(
token_identifiers: &Vec<String>,
token_identifiers: &[String],
ticker: &[u8],
) -> Option<(usize, String)> {
let extract_ticker =
|ti: &String| -> String { ti.split("-").map(|x| x.to_string()).next().unwrap() };
|ti: &String| -> String { ti.split('-').map(|x| x.to_string()).next().unwrap() };

let position = token_identifiers
token_identifiers
.iter()
.position(|x| extract_ticker(x).as_bytes() == ticker);

if let Some(i) = position {
Some((i, token_identifiers[i].clone()))
} else {
None
}
.position(|x| extract_ticker(x).as_bytes() == ticker)
.map(|i| (i, token_identifiers[i].clone()))
}

fn generate_token_identifier_from_ticker(
Expand Down

0 comments on commit 27e617c

Please sign in to comment.