add: display for Account

This commit is contained in:
realaltffour 2020-07-29 12:12:24 +03:00
parent 80413bfc81
commit 14258d0532
No known key found for this signature in database
GPG Key ID: C1265D839D44DCB1

View File

@ -1,8 +1,6 @@
use postgres_types::{ToSql, FromSql};
use crate::ds::account::portfolio::Portfolio;
#[derive(PartialEq, Debug, ToSql, FromSql)]
#[derive(PartialEq, Debug)]
pub struct Account {
pub username: String,
pub email: String,
@ -11,3 +9,9 @@ pub struct Account {
pub portfolio: Portfolio,
pub transactions: Vec<f64>
}
impl std::fmt::Display for Account {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "({}, {}, {}, {}, {}, {:#?})", self.username, self.email, self.is_pass, self.pass_hash, self.portfolio, self.transactions)
}
}