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