Fix clippy lints

This commit is contained in:
Paul Hauner
2021-09-25 10:31:13 +10:00
parent 4fe318c2e5
commit 9c8bf4965e
2 changed files with 2 additions and 2 deletions

View File

@@ -5,7 +5,7 @@
use crate::hex::PrefixedHexVisitor;
use serde::{Deserializer, Serializer};
pub fn serialize<S>(bytes: &Vec<u8>, serializer: S) -> Result<S::Ok, S::Error>
pub fn serialize<S>(bytes: &[u8], serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{

View File

@@ -51,7 +51,7 @@ where
let raw = hex::encode(num.to_be_bytes());
let trimmed = raw.trim_start_matches('0');
let hex = if trimmed == "" { "0" } else { &trimmed };
let hex = if trimmed.is_empty() { "0" } else { &trimmed };
serializer.serialize_str(&format!("0x{}", &hex))
}