diff --git a/exercises/03_ticket_v1/01_struct/src/lib.rs b/exercises/03_ticket_v1/01_struct/src/lib.rs index 1119e33..4e6d6d1 100644 --- a/exercises/03_ticket_v1/01_struct/src/lib.rs +++ b/exercises/03_ticket_v1/01_struct/src/lib.rs @@ -4,6 +4,16 @@ // // It should also have a method named `is_available` that returns a `true` if the quantity is // greater than 0, otherwise `false`. +struct Order { + price: u8, + quantity: u8, +} + +impl Order { + fn is_available(self) -> bool { + self.quantity > 0 + } +} #[cfg(test)] mod tests {