diff --git a/src/confirmation.rs b/src/confirmation.rs index b5570a1..ddecc6a 100644 --- a/src/confirmation.rs +++ b/src/confirmation.rs @@ -1,5 +1,5 @@ /// A mobile confirmation. There are multiple things that can be confirmed, like trade offers. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Copy)] pub struct Confirmation { pub id: u64, pub key: u64, @@ -8,7 +8,13 @@ pub struct Confirmation { /// Trade offer ID or market transaction ID pub creator: u64, pub conf_type: ConfirmationType, - pub description: String, +} + +impl Confirmation { + /// Human readable representation of this confirmation. + pub fn description(&self) -> String { + format!("{:?} id={} key={}", self.conf_type, self.id, self.key) + } } #[derive(Debug, Clone, Copy)] diff --git a/src/lib.rs b/src/lib.rs index 68daf53..b5956e7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -186,7 +186,6 @@ impl SteamGuardAccount { conf_type: conf_type, creator: conf_creator, int_type: 0, - description: "".into(), }]); } _ => { diff --git a/src/main.rs b/src/main.rs index 2ea030f..abb7efe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -134,7 +134,7 @@ fn main() { match account.get_trade_confirmations() { Ok(confs) => { for conf in confs { - println!("{:?}", conf); + println!("{}", conf.description()); } break; }