MCPcopy Create free account
hub / github.com/Apress/beginning-rust-2e / HasSquareRoot

Interface HasSquareRoot

Source Code/19-19.rs:4–6  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23.1622776601683795 3.1622777*/
3fn main() {
4 trait HasSquareRoot {
5 fn sqrt(self) -> Self;
6 }
7 impl HasSquareRoot for f32 {
8 fn sqrt(self) -> Self { self.sqrt() }
9 }

Callers

nothing calls this directly

Implementers 1

mainSource Code/19-19.rs

Calls

no outgoing calls

Tested by

no test coverage detected