mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-07-31 12:31:22 +00:00
Reverse a clone of [u8; 32] instead of allocating
This commit is contained in:
@@ -11,7 +11,7 @@ pub struct BlockHash(pub [u8; 32]);
|
|||||||
|
|
||||||
impl fmt::Display for BlockHash {
|
impl fmt::Display for BlockHash {
|
||||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||||
let mut data = self.0.to_vec();
|
let mut data = self.0.clone();
|
||||||
data.reverse();
|
data.reverse();
|
||||||
formatter.write_str(&hex::encode(data))
|
formatter.write_str(&hex::encode(data))
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,7 @@ pub struct TxId(pub [u8; 32]);
|
|||||||
|
|
||||||
impl fmt::Display for TxId {
|
impl fmt::Display for TxId {
|
||||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||||
let mut data = self.0.to_vec();
|
let mut data = self.0.clone();
|
||||||
data.reverse();
|
data.reverse();
|
||||||
formatter.write_str(&hex::encode(data))
|
formatter.write_str(&hex::encode(data))
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user