Commit 01a6f11
committed
fix(docs): wrap README batched-API code samples for doctest
The README is included via #![doc = include_str!("../README.md")] in
src/lib.rs, so every ```rust block becomes a doctest. The three new
samples I added under 'Batched APIs' used `?` against bare references
that didn't exist in the doctest scope, and weren't wrapped in a
fn returning Result.
CI on macOS 26 surfaced this as 3 doctest failures at lib.rs lines
725 / 746 / 758. Locally I'd been running `cargo test --tests` which
skips doctests, so I missed it.
Fix: tag the three samples `rust,no_run` and wrap each in a
`# fn example() -> Result<...>` so they compile + propagate ? cleanly.
Also stub out `sample` / `filter` / `config` references so the
samples no longer reference undefined names.
Verified locally with the same command CI runs:
cargo test --doc
→ 158 passed, 0 failed, 9 ignored.1 parent 04b415e commit 01a6f11
1 file changed
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
725 | | - | |
| 725 | + | |
726 | 726 | | |
727 | 727 | | |
728 | 728 | | |
| 729 | + | |
729 | 730 | | |
730 | 731 | | |
731 | 732 | | |
| |||
738 | 739 | | |
739 | 740 | | |
740 | 741 | | |
| 742 | + | |
| 743 | + | |
741 | 744 | | |
742 | 745 | | |
743 | 746 | | |
744 | 747 | | |
745 | 748 | | |
746 | | - | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
747 | 752 | | |
748 | 753 | | |
749 | 754 | | |
750 | 755 | | |
| 756 | + | |
751 | 757 | | |
752 | 758 | | |
753 | 759 | | |
754 | 760 | | |
755 | 761 | | |
756 | 762 | | |
757 | 763 | | |
758 | | - | |
759 | | - | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
760 | 772 | | |
| 773 | + | |
| 774 | + | |
761 | 775 | | |
762 | 776 | | |
763 | 777 | | |
| |||
0 commit comments