Commit 4488211
authored
future-proof enums
Add variants and attributes to future-proof enums. My guiding principles
were:
1. enums that reflect markdown should be exhaustive, since we can assume
a fairly stable markdown spec
2. enums that reflect mdq-specific inputs or non-markdown outputs
(specifically, errors) should be non-exhaustive, so that mdq can add new
features without breaking the API
Resolves #377. See that ticket for an analysis of the enums currently in
the code base.
## Breaking changes
- add `FrontMatterVariant::Json` variant
- change `FrontMatterVariant::separator()`'s signature to reflect that
Json doesn't have a separator line.
- add various `#[non_exhaustive]` attributes1 parent 7506347 commit 4488211
File tree
6 files changed
+75
-21
lines changed- src
- md_elem
- output
- run
6 files changed
+75
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
496 | 501 | | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
497 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
498 | 530 | | |
499 | 531 | | |
500 | 532 | | |
| |||
510 | 542 | | |
511 | 543 | | |
512 | 544 | | |
| 545 | + | |
513 | 546 | | |
514 | 547 | | |
515 | 548 | | |
516 | | - | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
517 | 552 | | |
518 | 553 | | |
519 | 554 | | |
520 | 555 | | |
521 | | - | |
522 | | - | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
523 | 559 | | |
524 | | - | |
| 560 | + | |
525 | 561 | | |
526 | | - | |
527 | | - | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
528 | 565 | | |
529 | 566 | | |
530 | 567 | | |
| |||
860 | 897 | | |
861 | 898 | | |
862 | 899 | | |
863 | | - | |
| 900 | + | |
864 | 901 | | |
865 | 902 | | |
866 | 903 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
402 | 403 | | |
403 | 404 | | |
404 | 405 | | |
405 | | - | |
406 | | - | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
407 | 410 | | |
408 | | - | |
409 | | - | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
410 | 415 | | |
411 | 416 | | |
412 | 417 | | |
| |||
582 | 587 | | |
583 | 588 | | |
584 | 589 | | |
| 590 | + | |
585 | 591 | | |
586 | 592 | | |
587 | 593 | | |
| |||
1394 | 1400 | | |
1395 | 1401 | | |
1396 | 1402 | | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
1397 | 1417 | | |
1398 | 1418 | | |
1399 | 1419 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
225 | 219 | | |
226 | 220 | | |
227 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
0 commit comments