Skip to content

Commit

Permalink
Consume Vec<Word> instead of copying words to vector
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtificialPB authored and vkgnosis committed Apr 7, 2022
1 parent 402b9fc commit 1339ef3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ethabi/src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl Mediate<'_> {
pub fn encode(tokens: &[Token]) -> Bytes {
let mediates = &tokens.iter().map(mediate_token).collect::<Vec<_>>();

encode_head_tail(mediates).iter().flat_map(|word| word.to_vec()).collect()
encode_head_tail(mediates).into_iter().flat_map(|word| word).collect()
}

fn encode_head_tail(mediates: &[Mediate]) -> Vec<Word> {
Expand Down

0 comments on commit 1339ef3

Please sign in to comment.