Repository navigation
Commit 60927a1
committed
refactor(server): prefer #[cfg] on fields over #[cfg_attr(not(...), allow(dead_code))]
Gate driver-specific fields on `ServerStartupConfig` and
`DriverStartupContext` (and the `GuestTlsPaths` type they reference)
with `#[cfg]` directly instead of double-negated
`#[cfg_attr(not(any(...)), allow(dead_code))]`. The direct form makes
the struct definition accurately reflect what exists per build and
removes the drift risk where a new driver reading one of these fields
would silently re-suppress the warning if the exclusion predicate went
stale.
Every construction site (`run_server`, `prepare_server_config`,
`test_context_with_endpoint_overrides`, `test_driver_startup`) is
updated to gate the matching field assignments with the same predicate,
so the gates cannot drift apart.
Split `apply_runtime_defaults` into a pure-side-effect `Result<()>`
plus a separate `resolved_local_tls` accessor so the call site no
longer needs a two-branch `#[cfg]` split around `let _ = ...` just
to keep the return value from being unused under
`--no-default-features`. The two are now clean concerns: one mutates
args, one reads TLS paths off disk. Callers invoke whichever they
need.
Signed-off-by: Dimitar Mirchev <[email protected]>1 parent 86a6880 commit 60927a1
3 files changed
Lines changed: 87 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
| |||
247 | 252 | | |
248 | 253 | | |
249 | 254 | | |
250 | | - | |
251 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
252 | 262 | | |
253 | 263 | | |
254 | 264 | | |
| |||
421 | 431 | | |
422 | 432 | | |
423 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
424 | 439 | | |
425 | 440 | | |
426 | 441 | | |
| |||
494 | 509 | | |
495 | 510 | | |
496 | 511 | | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
| 512 | + | |
| 513 | + | |
503 | 514 | | |
504 | 515 | | |
505 | 516 | | |
| |||
516 | 527 | | |
517 | 528 | | |
518 | 529 | | |
519 | | - | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
520 | 541 | | |
521 | 542 | | |
522 | 543 | | |
| |||
1156 | 1177 | | |
1157 | 1178 | | |
1158 | 1179 | | |
1159 | | - | |
| 1180 | + | |
| 1181 | + | |
1160 | 1182 | | |
1161 | 1183 | | |
1162 | 1184 | | |
| |||
1195 | 1217 | | |
1196 | 1218 | | |
1197 | 1219 | | |
1198 | | - | |
| 1220 | + | |
| 1221 | + | |
1199 | 1222 | | |
1200 | 1223 | | |
1201 | 1224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| |||
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
33 | 43 | | |
34 | 44 | | |
35 | 45 | | |
36 | 46 | | |
37 | 47 | | |
38 | 48 | | |
39 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
40 | 55 | | |
41 | 56 | | |
42 | 57 | | |
| |||
51 | 66 | | |
52 | 67 | | |
53 | 68 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
62 | 74 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 75 | + | |
67 | 76 | | |
68 | | - | |
| 77 | + | |
69 | 78 | | |
70 | 79 | | |
71 | 80 | | |
| |||
295 | 304 | | |
296 | 305 | | |
297 | 306 | | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
298 | 312 | | |
| 313 | + | |
299 | 314 | | |
| 315 | + | |
300 | 316 | | |
301 | 317 | | |
302 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
| |||
217 | 222 | | |
218 | 223 | | |
219 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
220 | 230 | | |
221 | 231 | | |
222 | 232 | | |
| |||
250 | 260 | | |
251 | 261 | | |
252 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
253 | 268 | | |
| 269 | + | |
254 | 270 | | |
| 271 | + | |
255 | 272 | | |
256 | 273 | | |
257 | 274 | | |
| |||
1014 | 1031 | | |
1015 | 1032 | | |
1016 | 1033 | | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
1017 | 1039 | | |
| 1040 | + | |
1018 | 1041 | | |
| 1042 | + | |
1019 | 1043 | | |
1020 | 1044 | | |
1021 | 1045 | | |
| |||
0 commit comments