Commit 4452c2f
authored
refactor: embed deserialize validation logic in ProgressConfig (#16194)
### What does this PR try to resolve?
We have a custom `serde(deserialize_with = "progress_or_string")` to
support
`term.progress = "never" | "auto" | <progress table>`.
It was claimed we added in #8165 [^1] but actually never
worked,
because `Deserializer::deserialize_option` [^2] never called
`visit_str`.
This PR remove the custom `progress_or_string`
so that the deserialization logic can be baked in the type itself.
### How to test and review this PR?
I've tested 1.50 Cargo and `progress = "never"` failed with the same
reason as the newly added test.
[^1]:
#8165 (comment)
[^2]:
https://github.com/rust-lang/cargo/blob/c369b8c8d85a/src/cargo/util/config/de.rs#L135-L145File tree
2 files changed
+53
-62
lines changed- src/cargo/util/context
- tests/testsuite
2 files changed
+53
-62
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
342 | 341 | | |
343 | 342 | | |
344 | 343 | | |
345 | | - | |
| 344 | + | |
346 | 345 | | |
347 | 346 | | |
348 | 347 | | |
349 | 348 | | |
350 | 349 | | |
351 | 350 | | |
352 | 351 | | |
353 | | - | |
354 | | - | |
355 | 352 | | |
356 | 353 | | |
357 | 354 | | |
| |||
369 | 366 | | |
370 | 367 | | |
371 | 368 | | |
372 | | - | |
373 | | - | |
| 369 | + | |
374 | 370 | | |
375 | | - | |
376 | 371 | | |
377 | 372 | | |
378 | 373 | | |
| |||
388 | 383 | | |
389 | 384 | | |
390 | 385 | | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
429 | 400 | | |
430 | 401 | | |
431 | | - | |
432 | | - | |
433 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
434 | 408 | | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
447 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
448 | 418 | | |
449 | | - | |
450 | | - | |
451 | 419 | | |
452 | 420 | | |
453 | 421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
0 commit comments