Skip to content

Commit

Permalink
fixed clippy warnings in macos build;
Browse files Browse the repository at this point in the history
  • Loading branch information
ph0llux committed Jul 28, 2024
1 parent 4702838 commit 89720fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub fn buffer_to_hex<T, S>(buffer: &T, serializer: S) -> std::result::Result<S::
where T: AsRef<[u8]>,
S: serde::Serializer
{
serializer.serialize_str(&hex::encode(&buffer))
serializer.serialize_str(&hex::encode(buffer))
}

#[cfg(feature = "serde")]
Expand All @@ -83,7 +83,7 @@ pub fn hex_to_buffer<'de, D>(deserializer: D) -> std::result::Result<Vec<u8>, D:
{
use serde::de::Error;
String::deserialize(deserializer)
.and_then(|string| Vec::from_hex(&string).map_err(|err| Error::custom(err.to_string())))
.and_then(|string| Vec::from_hex(string).map_err(|err| Error::custom(err.to_string())))
}

#[cfg(feature = "serde")]
Expand All @@ -93,7 +93,7 @@ where
T: AsRef<[u8]>,
S: serde::Serializer
{
serializer.serialize_str(&base64engine.encode(&buffer))
serializer.serialize_str(&base64engine.encode(buffer))
}

#[cfg(feature = "serde")]
Expand All @@ -114,7 +114,7 @@ pub fn base64_to_buffer<'de, D>(deserializer: D) -> std::result::Result<Vec<u8>,
where D: serde::Deserializer<'de>
{
use serde::de::Error;
String::deserialize(deserializer).and_then(|string| base64engine.decode(&string).map_err(|err| Error::custom(err.to_string())))
String::deserialize(deserializer).and_then(|string| base64engine.decode(string).map_err(|err| Error::custom(err.to_string())))
}


Expand Down

0 comments on commit 89720fc

Please sign in to comment.