openethereum/util/json-tests/src/util.rs
2016-01-17 13:11:25 +01:00

9 lines
176 B
Rust

use rustc_serialize::hex::FromHex;
pub fn hex_or_string(s: &str) -> Vec<u8> {
match s.starts_with("0x") {
true => s[2..].from_hex().unwrap(),
false => From::from(s)
}
}