| 3 | // This is a simple library to calculate square-roots from integers. |
| 4 | |
| 5 | pub trait IntSqRoot |
| 6 | { |
| 7 | fn intsqroot(&self) -> Self |
| 8 | where |
| 9 | Self: Sized, |
| 10 | { |
| 11 | self.intsqroot_check() |
| 12 | .expect("[ERR] CANNOT CALCULATE THE SQUARE ROOT OF A NEGATIVE INTEGER") |
| 13 | } |
| 14 | |
| 15 | // Calculate the square root, or return "None" in the event of the integer being negative. |
| 16 | fn intsqroot_check(&self) -> Option<Self> |
| 17 | where |
| 18 | Self: Sized; |
| 19 | } |
| 20 | |
| 21 | |
| 22 | impl<T: num_traits::PrimInt> IntSqRoot for T |
nothing calls this directly
no outgoing calls
no test coverage detected