completed 03/[00-07]
This commit is contained in:
@@ -5,6 +5,17 @@
|
||||
// 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: u32,
|
||||
quantity: u32,
|
||||
}
|
||||
|
||||
impl Order{
|
||||
fn is_available(self)-> bool{
|
||||
self.quantity >0
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user