completed most of 05 ticket v2
This commit is contained in:
@@ -9,7 +9,13 @@ enum Shape {
|
||||
impl Shape {
|
||||
// TODO: Implement the `n_sides` method using a `match`.
|
||||
pub fn n_sides(&self) -> u8 {
|
||||
todo!()
|
||||
match self {
|
||||
Self::Circle => 0,
|
||||
Self::Pentagon => 5,
|
||||
Self::Rectangle => 4,
|
||||
Self::Square => 4,
|
||||
Self::Triangle => 3,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user