fix(browser): cfg-gate BrowserPaneSnapshot import for wasm clippy#163
Open
BunsDev wants to merge 2 commits into
Open
fix(browser): cfg-gate BrowserPaneSnapshot import for wasm clippy#163BunsDev wants to merge 2 commits into
BunsDev wants to merge 2 commits into
Conversation
The `snapshot()` method only references `BrowserPaneSnapshot` inside its `#[cfg(not(target_family = "wasm"))]` block (the wasm branch returns `LeafContents::NetworkLog` since wasm has no WebKit data store to persist), so the unconditional `use crate::app_state::BrowserPaneSnapshot` became an unused import on wasm and tripped `Formatting + Clippy (wasm)` with `-D warnings`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Cfg-gates the BrowserPaneSnapshot import in browser_pane.rs to non-wasm targets, fixing a wasm clippy unused_import failure since the type is only referenced inside the non-wasm branch of snapshot().
Changes:
- Split the combined import so
LeafContentsremains unconditional andBrowserPaneSnapshotis gated behind#[cfg(not(target_family = "wasm"))].
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Original commit on this branch put `LeafContents` before `BrowserPaneSnapshot`, which failed `cargo fmt --check` on every platform. rustfmt expects the alphabetical order regardless of the intervening `#[cfg]` attribute. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Follow-up to #153. The wasm
Formatting + Clippyjob failed onmainwitherror: unused import: BrowserPaneSnapshotbecausesnapshot()only references the type inside its#[cfg(not(target_family = "wasm"))]block (the wasm branch returnsLeafContents::NetworkLogsince there's no WebKit data store to persist on wasm), but theusestatement was unconditional.Test plan
cargo clippy --locked --target wasm32-unknown-unknown --profile release-wasm-debug_assertions -- -D warnings(matches CI invocation)cargo check -p warp-app --lib— confirm BrowserPaneSnapshot is still resolved in the non-wasm branch🤖 Generated with Claude Code