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

Class Complex

Source Code/20-05.rs:4–7  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22.3 + 6.5i*/
3fn main() {
4 struct Complex {
5 re: f64,
6 im: f64,
7 }
8 fn add_complex(lhs: Complex, rhs: Complex) -> Complex {
9 Complex { re: lhs.re + rhs.re, im: lhs.im + rhs.im }
10 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected