price_checker/src/price_result.rs

14 lines
327 B
Rust
Raw Normal View History

2020-05-23 14:19:04 +00:00
use std::fmt;
2020-05-11 19:21:57 +00:00
#[derive(PartialEq, Clone, Debug)]
pub struct PriceResult {
pub name: String,
pub product: String,
pub price: f64
2020-05-23 14:19:04 +00:00
}
impl fmt::Display for PriceResult {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "Product «{}: {}» price {}€", self.product, self.name, self.price)
}
2020-05-11 19:21:57 +00:00
}