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

Interface HasSquareRoot

Source Code/19-13.rs:5–7  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Implementers 1

mainSource Code/19-13.rs

Calls

no outgoing calls

Tested by

no test coverage detected