Merge remote-tracking branch 'garious/add-as-ref' into develop

This commit is contained in:
Isis Lovecruft
2018-12-18 01:13:13 +00:00

View File

@@ -183,6 +183,12 @@ impl Drop for SecretKey {
}
}
impl AsRef<[u8]> for SecretKey {
fn as_ref(&self) -> &[u8] {
self.as_bytes()
}
}
impl SecretKey {
/// Expand this `SecretKey` into an `ExpandedSecretKey`.
pub fn expand<D>(&self) -> ExpandedSecretKey
@@ -715,6 +721,12 @@ impl Debug for PublicKey {
}
}
impl AsRef<[u8]> for PublicKey {
fn as_ref(&self) -> &[u8] {
self.as_bytes()
}
}
impl PublicKey {
/// Convert this public key to a byte array.
#[inline]