Read complex numbers line by line

According to this page, the trait which is responsible to format a complex number for printing (to a file or stdout) has been implemented somewhere. How to read it instead? I couldn't find anything related.

Just found out that the ToString and FromStr traits have been implemented for num::complex::Complex.

let mut s = String::new();
<buffer>.read_line(&mut s);
let c = from_str(&s);

Something like that.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.