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

@@ -7,8 +7,19 @@ enum Shape {
impl Shape {
// TODO: Implement the `radius` method using
// either an `if let` or a `let/else`.
// pub fn radius(&self) -> f64 {
// if let Shape::Circle { radius } = self {
// return radius.clone();
// } else {
// panic!("");
// }
// }
pub fn radius(&self) -> f64 {
todo!()
let Shape::Circle { radius } = self else {
panic!("");
};
radius.clone()
}
}