Эх сурвалжийг харах

Implement Default for Complex

Fixes #198
Adam Crume 8 жил өмнө
parent
commit
c7c974ec4b
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      complex/src/lib.rs

+ 1 - 1
complex/src/lib.rs

@@ -29,7 +29,7 @@ use traits::{Zero, One, Num, Float};
 // probably doesn't map to C's _Complex correctly.
 
 /// A complex number in Cartesian form.
-#[derive(PartialEq, Copy, Clone, Hash, Debug)]
+#[derive(PartialEq, Copy, Clone, Hash, Debug, Default)]
 #[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))]
 pub struct Complex<T> {
     /// Real portion of the complex number