completed most of 05 ticket v2
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user