Skip to content

staging: non-exhaustive Format (mirror of upstream #154) - #9

Open
marcellmanfrin wants to merge 2 commits into
mainfrom
fix/format-non-exhaustive
Open

marcellmanfrin wants to merge 2 commits into
mainfrom
fix/format-non-exhaustive

Conversation

@marcellmanfrin

@marcellmanfrin marcellmanfrin commented Sep 1, 2026

Copy link
Copy Markdown
Owner

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 Format as #[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 defensive unreachable! arms because they match anydoc::Format exhaustively; Python bindings need no change.

Written for commit 7a5c8ba. Summary will update on new commits.

Review in cubic

Marcell Manfrin 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.
@marcellmanfrin

Copy link
Copy Markdown
Owner Author

@cubic-dev-ai ultrareview: focus on the #[non_exhaustive] API change and the wildcard arms added to the Node/WASM bindings.

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 1, 2026

Copy link
Copy Markdown

@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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultrareview completed in 2m 41s

No issues found across 3 files

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant