Skip to content

Commit

Permalink
simplify Selector::hex_lits method using array::map API
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbepop committed Sep 20, 2021
1 parent 0ef98cc commit 802684d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions crates/lang/ir/src/ir/selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,7 @@ impl Selector {

/// Returns the 4 bytes that make up the selector as hex encoded bytes.
pub fn hex_lits(self) -> [syn::LitInt; 4] {
let selector_bytes = self.as_bytes();
[
selector_bytes[0].hex_padded_suffixed(),
selector_bytes[1].hex_padded_suffixed(),
selector_bytes[2].hex_padded_suffixed(),
selector_bytes[3].hex_padded_suffixed(),
]
self.bytes.map(<u8 as HexLiteral>::hex_padded_suffixed)
}
}

Expand Down

0 comments on commit 802684d

Please sign in to comment.