completed most of 05 ticket v2

This commit is contained in:
2025-03-17 06:39:58 +05:30
parent 8d1342c831
commit 8413518a84
14 changed files with 132 additions and 27 deletions

View File

@@ -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,
}
}
}