mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 13:28:33 +00:00
Update all crates versions
This commit is contained in:
@@ -5,5 +5,5 @@ authors = ["Paul Hauner <paul@paulhauner.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
serde = "1.0.102"
|
||||
hex = "0.3"
|
||||
serde = "1.0.106"
|
||||
hex = "0.4.2"
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
use hex::ToHex;
|
||||
use serde::de::{self, Visitor};
|
||||
use std::fmt;
|
||||
|
||||
pub fn encode<T: AsRef<[u8]>>(data: T) -> String {
|
||||
let mut hex = String::with_capacity(data.as_ref().len() * 2);
|
||||
|
||||
// Writing to a string never errors, so we can unwrap here.
|
||||
data.write_hex(&mut hex).unwrap();
|
||||
|
||||
let hex = hex::encode(data);
|
||||
let mut s = "0x".to_string();
|
||||
|
||||
s.push_str(hex.as_str());
|
||||
|
||||
s
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user