File tree Expand file tree Collapse file tree 8 files changed +48
-0
lines changed Expand file tree Collapse file tree 8 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,12 @@ impl Box {
79
79
}
80
80
}
81
81
82
+ impl Default for Box {
83
+ fn default ( ) -> Self {
84
+ Self :: zero ( )
85
+ }
86
+ }
87
+
82
88
impl fmt:: Debug for Box {
83
89
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
84
90
f. debug_struct ( "Box" )
Original file line number Diff line number Diff line change @@ -213,6 +213,12 @@ impl fmt::Debug for Matrix {
213
213
}
214
214
}
215
215
216
+ impl Default for Matrix {
217
+ fn default ( ) -> Self {
218
+ Self :: new_identity ( )
219
+ }
220
+ }
221
+
216
222
#[ cfg( test) ]
217
223
mod tests {
218
224
use super :: Matrix ;
Original file line number Diff line number Diff line change @@ -57,3 +57,9 @@ impl fmt::Debug for Point {
57
57
. finish ( )
58
58
}
59
59
}
60
+
61
+ impl Default for Point {
62
+ fn default ( ) -> Self {
63
+ Self :: zero ( )
64
+ }
65
+ }
Original file line number Diff line number Diff line change @@ -68,3 +68,9 @@ impl fmt::Debug for Point3D {
68
68
. finish ( )
69
69
}
70
70
}
71
+
72
+ impl Default for Point3D {
73
+ fn default ( ) -> Self {
74
+ Self :: zero ( )
75
+ }
76
+ }
Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ impl fmt::Debug for Rect {
39
39
}
40
40
}
41
41
42
+ impl Default for Rect {
43
+ fn default ( ) -> Self {
44
+ Self :: zero ( )
45
+ }
46
+ }
47
+
42
48
#[ cfg( test) ]
43
49
mod tests {
44
50
use super :: * ;
Original file line number Diff line number Diff line change @@ -46,3 +46,9 @@ impl fmt::Debug for Vec2 {
46
46
. finish ( )
47
47
}
48
48
}
49
+
50
+ impl Default for Vec2 {
51
+ fn default ( ) -> Self {
52
+ Self :: zero ( )
53
+ }
54
+ }
Original file line number Diff line number Diff line change @@ -47,3 +47,9 @@ impl fmt::Debug for Vec3 {
47
47
. finish ( )
48
48
}
49
49
}
50
+
51
+ impl Default for Vec3 {
52
+ fn default ( ) -> Self {
53
+ Self :: zero ( )
54
+ }
55
+ }
Original file line number Diff line number Diff line change @@ -70,3 +70,9 @@ impl fmt::Debug for Vec4 {
70
70
. finish ( )
71
71
}
72
72
}
73
+
74
+ impl Default for Vec4 {
75
+ fn default ( ) -> Self {
76
+ Self :: zero ( )
77
+ }
78
+ }
You can’t perform that action at this time.
0 commit comments