mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-15 11:01:21 +00:00
Add AsRef<u8> for Multihash. (#1161)
* Add AsRef<u8> for Multihash. * Bump patch version of multihash.
This commit is contained in:
committed by
Pierre Krieger
parent
f51573b628
commit
a2550215a0
@ -4,7 +4,7 @@ edition = "2018"
|
|||||||
description = "Implementation of the multihash format"
|
description = "Implementation of the multihash format"
|
||||||
repository = "https://github.com/libp2p/rust-libp2p"
|
repository = "https://github.com/libp2p/rust-libp2p"
|
||||||
keywords = ["multihash", "ipfs"]
|
keywords = ["multihash", "ipfs"]
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
authors = ["dignifiedquire <dignifiedquire@gmail.com>", "Parity Technologies <admin@parity.io>"]
|
authors = ["dignifiedquire <dignifiedquire@gmail.com>", "Parity Technologies <admin@parity.io>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
documentation = "https://docs.rs/parity-multihash/"
|
documentation = "https://docs.rs/parity-multihash/"
|
||||||
|
@ -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 {
|
impl<'a> PartialEq<MultihashRef<'a>> for Multihash {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn eq(&self, other: &MultihashRef<'a>) -> bool {
|
fn eq(&self, other: &MultihashRef<'a>) -> bool {
|
||||||
|
Reference in New Issue
Block a user