Skip to content

Commit a18ea4b

Browse files
committed
graph: Resolve &str to Vec<u8> directly on replace, using .into_bytes()
1 parent fa9bcc5 commit a18ea4b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

graph/src/util/ethereum.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ use tiny_keccak::Keccak;
55
/// Hashes a string to a H256 hash.
66
pub fn string_to_h256(s: &str) -> H256 {
77
let mut result = [0u8; 32];
8-
let ss = &s.replace(" ", "")[..];
9-
let data: Vec<u8> = From::from(s);
8+
let data = s.replace(" ", "").into_bytes();
109
let mut sponge = Keccak::new_keccak256();
1110
sponge.update(&data);
1211
sponge.finalize(&mut result);

0 commit comments

Comments
 (0)