Add AsRef<u8> for Multihash. (#1161)

* Add AsRef<u8> for Multihash.

* Bump patch version of multihash.
This commit is contained in:
Roman Borschel
2019-06-05 10:27:06 +02:00
committed by Pierre Krieger
parent f51573b628
commit a2550215a0
2 changed files with 7 additions and 1 deletions

View File

@ -4,7 +4,7 @@ edition = "2018"
description = "Implementation of the multihash format"
repository = "https://github.com/libp2p/rust-libp2p"
keywords = ["multihash", "ipfs"]
version = "0.1.1"
version = "0.1.2"
authors = ["dignifiedquire <dignifiedquire@gmail.com>", "Parity Technologies <admin@parity.io>"]
license = "MIT"
documentation = "https://docs.rs/parity-multihash/"

View File

@ -158,6 +158,12 @@ impl Multihash {
}
}
impl AsRef<[u8]> for Multihash {
fn as_ref(&self) -> &[u8] {
self.as_bytes()
}
}
impl<'a> PartialEq<MultihashRef<'a>> for Multihash {
#[inline]
fn eq(&self, other: &MultihashRef<'a>) -> bool {