staging: non-exhaustive Format (mirror of upstream #154) - #9
Open
marcellmanfrin wants to merge 2 commits into
Open
marcellmanfrin wants to merge 2 commits into
marcellmanfrin wants to merge 2 commits into
Conversation
added 2 commits
August 31, 2026 21:13
New formats are added over time: standalone HTML and MHTML support are in flight in firecrawl#147 and firecrawl#149. Adding a variant to the public Format enum breaks downstream users that match it exhaustively. Mark the enum #[non_exhaustive] so future variants are forward-compatible: crates outside this workspace must include a wildcard arm when matching. The in-repo Node and WASM bindings match anydoc::Format exhaustively, so add an explicit unreachable arm to each From<anydoc::Format> implementation; the bindings are released in lockstep with the core crate, so the arm is defensive only. The Python bindings resolve format names through a lookup table and need no change. Motivated by the Cubic finding on firecrawl#149 (src/lib.rs:50).
Cubic finding (PR 154, src/lib.rs): the doc note wrongly implied that downstream exhaustive matches keep compiling. #[non_exhaustive] requires downstream callers to match with a wildcard arm; only wildcard-bearing matches remain compatible with future variants. Full gate re-run on this exact tree: Rust fmt/clippy/tests clean, Node 19/19 with deterministic bindings, WASM 8/8, Python 11/11.
Owner
Author
|
@cubic-dev-ai ultrareview: focus on the #[non_exhaustive] API change and the wildcard arms added to the Node/WASM bindings. |
@marcellmanfrin Starting ultrareview. I'll post findings when complete. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Staging PR for Cubic ultrareview only — mirrors the content of firecrawl#154 at its current head. Do not merge; the real review happens upstream. This PR exists because the ultrareview seat is available on this fork's installation but not on the upstream organization's.
Summary by cubic
Marks
Formatas#[non_exhaustive]so future format variants won't break downstream code that matches the enum exhaustively.Downstream callers must now include a wildcard arm when matching
Format. The Node and WASM bindings get defensiveunreachable!arms because they matchanydoc::Formatexhaustively; Python bindings need no change.Written for commit 7a5c8ba. Summary will update on new commits.