Skip to content

Commit

Permalink
{Signing,Verifying}KeyVisitor: visit_borrowed_bytes -> visit_bytes (#602
Browse files Browse the repository at this point in the history
)
  • Loading branch information
awesterb committed Nov 17, 2023
1 parent f08bbb7 commit a2ff6ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions ed25519-dalek/src/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,10 +746,7 @@ impl<'d> Deserialize<'d> for SigningKey {
write!(formatter, concat!("An ed25519 signing (private) key"))
}

fn visit_borrowed_bytes<E: serde::de::Error>(
self,
bytes: &'de [u8],
) -> Result<Self::Value, E> {
fn visit_bytes<E: serde::de::Error>(self, bytes: &[u8]) -> Result<Self::Value, E> {
SigningKey::try_from(bytes).map_err(E::custom)
}

Expand Down
5 changes: 1 addition & 4 deletions ed25519-dalek/src/verifying.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,10 +636,7 @@ impl<'d> Deserialize<'d> for VerifyingKey {
write!(formatter, concat!("An ed25519 verifying (public) key"))
}

fn visit_borrowed_bytes<E: serde::de::Error>(
self,
bytes: &'de [u8],
) -> Result<Self::Value, E> {
fn visit_bytes<E: serde::de::Error>(self, bytes: &[u8]) -> Result<Self::Value, E> {
VerifyingKey::try_from(bytes).map_err(E::custom)
}

Expand Down

0 comments on commit a2ff6ba

Please sign in to comment.