Move BlockHash From impls
Move the `From` impls on `BlockHash` to below the `BlockHash` impl block. Code move only, no other changes.
This commit is contained in:
parent
b5aa482532
commit
3a9b5526b3
|
@ -337,6 +337,22 @@ impl Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<Header> for BlockHash {
|
||||||
|
fn from(header: Header) -> BlockHash { header.block_hash() }
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<&Header> for BlockHash {
|
||||||
|
fn from(header: &Header) -> BlockHash { header.block_hash() }
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<Block> for BlockHash {
|
||||||
|
fn from(block: Block) -> BlockHash { block.block_hash() }
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<&Block> for BlockHash {
|
||||||
|
fn from(block: &Block) -> BlockHash { block.block_hash() }
|
||||||
|
}
|
||||||
|
|
||||||
/// An error when looking up a BIP34 block height.
|
/// An error when looking up a BIP34 block height.
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
|
@ -375,22 +391,6 @@ impl std::error::Error for Bip34Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<Header> for BlockHash {
|
|
||||||
fn from(header: Header) -> BlockHash { header.block_hash() }
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<&Header> for BlockHash {
|
|
||||||
fn from(header: &Header) -> BlockHash { header.block_hash() }
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<Block> for BlockHash {
|
|
||||||
fn from(block: Block) -> BlockHash { block.block_hash() }
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<&Block> for BlockHash {
|
|
||||||
fn from(block: &Block) -> BlockHash { block.block_hash() }
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use hashes::hex::FromHex;
|
use hashes::hex::FromHex;
|
||||||
|
|
Loading…
Reference in New Issue