Commit 010e6fc
committed
refactor: use composition for TrackerPorts in DockerComposeContext
- Changed DockerComposeContext from flattened port fields to composed TrackerPorts field
- Added Serialize derive to TrackerPorts for proper JSON serialization
- Simplified constructors to use direct field move instead of destructuring
- Replaced 3 individual accessor methods with single ports() getter
- Updated Tera template to use nested access pattern (ports.field_name)
- Maintains all existing test contracts (9/9 tests passing)
Benefits:
- Single source of truth for port structure (DRY principle)
- Better type safety and semantic grouping
- Easier maintenance - change port structure in one place
- More idiomatic Rust composition pattern1 parent b056f2a commit 010e6fc
File tree
2 files changed
+17
-37
lines changed- src/infrastructure/templating/docker_compose/template/wrappers/docker_compose
- templates/docker-compose
2 files changed
+17
-37
lines changedLines changed: 14 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 19 | + | |
| 20 | + | |
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
| |||
54 | 50 | | |
55 | 51 | | |
56 | 52 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 53 | + | |
60 | 54 | | |
61 | 55 | | |
62 | 56 | | |
| |||
112 | 106 | | |
113 | 107 | | |
114 | 108 | | |
115 | | - | |
116 | | - | |
117 | | - | |
| 109 | + | |
118 | 110 | | |
119 | 111 | | |
120 | 112 | | |
| |||
136 | 128 | | |
137 | 129 | | |
138 | 130 | | |
139 | | - | |
| 131 | + | |
140 | 132 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 133 | + | |
| 134 | + | |
155 | 135 | | |
156 | 136 | | |
157 | 137 | | |
| |||
162 | 142 | | |
163 | 143 | | |
164 | 144 | | |
165 | | - | |
| 145 | + | |
166 | 146 | | |
167 | 147 | | |
168 | 148 | | |
| |||
226 | 206 | | |
227 | 207 | | |
228 | 208 | | |
229 | | - | |
230 | | - | |
231 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
232 | 212 | | |
233 | 213 | | |
234 | 214 | | |
| |||
257 | 237 | | |
258 | 238 | | |
259 | 239 | | |
260 | | - | |
261 | | - | |
262 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
263 | 243 | | |
264 | 244 | | |
265 | 245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
0 commit comments