(&self)
| 1682 | // caller object. In this case `Self` = `Rectangle` |
| 1683 | #[allow(dead_code)] |
| 1684 | fn area(&self) -> f64 { |
| 1685 | // `self` gives access to the struct fields via the dot operator |
| 1686 | let Point { x: x1, y: y1 } = self.p1; |
| 1687 | let Point { x: x2, y: y2 } = self.p2; |
| 1688 | |
| 1689 | // `abs` is a `f64` method that returns the absolute value of the |
| 1690 | // caller |
| 1691 | ((x1 - x2) * (y1 - y2)).abs() |
| 1692 | } |
| 1693 | |
| 1694 | #[allow(dead_code)] |
| 1695 | fn perimeter(&self) -> f64 { |
nothing calls this directly
no outgoing calls
no test coverage detected