summaryrefslogtreecommitdiff
path: root/ex3_12/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ex3_12/src/main.rs')
-rw-r--r--ex3_12/src/main.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/ex3_12/src/main.rs b/ex3_12/src/main.rs
new file mode 100644
index 0000000..18effb1
--- /dev/null
+++ b/ex3_12/src/main.rs
@@ -0,0 +1,14 @@
+mod order;
+
+use order::Order;
+
+fn main() {
+ let mut o = match Order::new("p",1,1) {
+ Ok(_o) => _o,
+ Err(e) => panic!("{}", e),
+ };
+ o.set_product_name("p2");
+ o.set_quantity(2);
+ o.set_unit_price(2);
+ println!("{}{}{}{}", o.product_name(), o.quantity(), o.unit_price(), o.total());
+}