File tree Expand file tree Collapse file tree 8 files changed +12
-30
lines changed
experiments/2024-12-09/src Expand file tree Collapse file tree 8 files changed +12
-30
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,8 @@ pub trait Operation {
15
15
}
16
16
}
17
17
18
- pub trait OperationOutput : Operation {
19
- type Output ;
20
-
21
- fn output ( & self ) -> & Self :: Output ;
18
+ pub trait OperationOutput < Output = Self > : Operation {
19
+ fn output ( & self ) -> & Output ;
22
20
}
23
21
24
22
pub struct OperationDisplay < ' r > {
@@ -103,9 +101,7 @@ impl Operation for AnyOp {
103
101
}
104
102
105
103
impl OperationOutput for AnyOp {
106
- type Output = Self ;
107
-
108
- fn output ( & self ) -> & Self :: Output {
104
+ fn output ( & self ) -> & Self {
109
105
self
110
106
}
111
107
}
Original file line number Diff line number Diff line change @@ -40,9 +40,7 @@ impl Operation for Triangle {
40
40
}
41
41
42
42
impl OperationOutput for Triangle {
43
- type Output = Self ;
44
-
45
- fn output ( & self ) -> & Self :: Output {
43
+ fn output ( & self ) -> & Self {
46
44
self
47
45
}
48
46
}
Original file line number Diff line number Diff line change @@ -75,10 +75,8 @@ impl Operation for Connect {
75
75
}
76
76
}
77
77
78
- impl OperationOutput for Connect {
79
- type Output = Solid ;
80
-
81
- fn output ( & self ) -> & Self :: Output {
78
+ impl OperationOutput < Solid > for Connect {
79
+ fn output ( & self ) -> & Solid {
82
80
& self . output
83
81
}
84
82
}
Original file line number Diff line number Diff line change @@ -121,9 +121,7 @@ impl Operation for Face {
121
121
}
122
122
123
123
impl OperationOutput for Face {
124
- type Output = Self ;
125
-
126
- fn output ( & self ) -> & Self :: Output {
124
+ fn output ( & self ) -> & Self {
127
125
self
128
126
}
129
127
}
Original file line number Diff line number Diff line change @@ -36,9 +36,7 @@ impl Operation for Solid {
36
36
}
37
37
}
38
38
impl OperationOutput for Solid {
39
- type Output = Self ;
40
-
41
- fn output ( & self ) -> & Self :: Output {
39
+ fn output ( & self ) -> & Self {
42
40
self
43
41
}
44
42
}
Original file line number Diff line number Diff line change @@ -56,10 +56,8 @@ impl Operation for Sweep {
56
56
}
57
57
}
58
58
59
- impl OperationOutput for Sweep {
60
- type Output = Solid ;
61
-
62
- fn output ( & self ) -> & Self :: Output {
59
+ impl OperationOutput < Solid > for Sweep {
60
+ fn output ( & self ) -> & Solid {
63
61
self . output . output ( )
64
62
}
65
63
}
Original file line number Diff line number Diff line change @@ -44,9 +44,7 @@ impl Operation for Vertex {
44
44
}
45
45
46
46
impl OperationOutput for Vertex {
47
- type Output = Self ;
48
-
49
- fn output ( & self ) -> & Self :: Output {
47
+ fn output ( & self ) -> & Self {
50
48
self
51
49
}
52
50
}
Original file line number Diff line number Diff line change @@ -133,9 +133,7 @@ impl Operation for OperationView {
133
133
}
134
134
135
135
impl OperationOutput for OperationView {
136
- type Output = Self ;
137
-
138
- fn output ( & self ) -> & Self :: Output {
136
+ fn output ( & self ) -> & Self {
139
137
self
140
138
}
141
139
}
You can’t perform that action at this time.
0 commit comments