Skip to content

Commit

Permalink
Adds FromStr trait to generic model
Browse files Browse the repository at this point in the history
  • Loading branch information
howardwu committed Jul 9, 2019
1 parent 361f1a2 commit 4505e03
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion model/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ use crate::public_key::PublicKey;
use std::{
fmt::{Debug, Display},
hash::Hash,
str::FromStr
};

/// The interface for a generic address.
pub trait Address:
Clone + Debug + Display + Send + Sync + 'static + Eq + Ord + Sized + Hash
Clone + Debug + Display + FromStr + Send + Sync + 'static + Eq + Ord + Sized + Hash
{
type Format;
type Network;
Expand Down
1 change: 0 additions & 1 deletion model/src/private_key.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::address::Address;
use crate::public_key::PublicKey;


use std::{fmt::{Debug, Display}, str::FromStr};

/// The interface for a generic private key.
Expand Down
3 changes: 2 additions & 1 deletion model/src/public_key.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::address::Address;
use crate::private_key::PrivateKey;


use std::{
fmt::{Debug, Display},
hash::Hash,
str::FromStr
};

/// The interface for a generic public key.
Expand All @@ -15,6 +15,7 @@ pub trait PublicKey:
+ Clone
+ Debug
+ Display
+ FromStr
+ Send
+ Sync
+ 'static
Expand Down

0 comments on commit 4505e03

Please sign in to comment.