Skip to content

Commit

Permalink
Derive Debug for Randomness
Browse files Browse the repository at this point in the history
  • Loading branch information
timvermeulen committed May 22, 2020
1 parent 9c1cf73 commit 9ce0cfc
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions vm/src/randomness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@

use encoding::{Byte32De, BytesSer};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::fmt::{self, Debug, Formatter};

/// String of random bytes
#[derive(PartialEq, Eq, Default, Copy, Clone)]
#[derive(PartialEq, Eq, Default, Copy, Clone, Debug)]
pub struct Randomness(pub [u8; 32]);

impl Debug for Randomness {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
self.0.fmt(f)
}
}

impl Serialize for Randomness {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
Expand Down

0 comments on commit 9ce0cfc

Please sign in to comment.