logo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use super::*;

impl<T> ValidShape<T> for Triangle<T>
where
    T: Zero,
{
    fn is_empty_under_thousand(&self, thousand: T) -> bool {
        todo!()
    }
}

impl<T> ValidShape<T> for Square<T>
where
    T: Zero + PartialOrd,
{
    fn is_empty_under_thousand(&self, thousand: T) -> bool {
        self.side <= thousand
    }
}

impl<T> ValidShape<T> for Rectangle<T>
where
    T: Zero + PartialOrd,
{
    fn is_empty_under_thousand(&self, thousand: T) -> bool {
        self.side.0 <= thousand && self.side.1 <= thousand
    }
}