Skip to content

refactor: drop unread SourceProductMirror fields#159

Open
alukach wants to merge 1 commit into
mainfrom
refactor/drop-dead-mirror-fields
Open

refactor: drop unread SourceProductMirror fields#159
alukach wants to merge 1 commit into
mainfrom
refactor/drop-dead-mirror-fields

Conversation

@alukach

@alukach alukach commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What

SourceProductMirror carried storage_type and is_primary fields that are deserialized from the API but never read anywhere — which is why the struct needed an #[allow(dead_code)]. Remove both fields and the attribute.

#[derive(Debug, Clone, Deserialize)]
pub struct SourceProductMirror {
    pub connection_id: String,
    pub prefix: String,
}

Why

serde ignores unknown JSON fields by default, so a struct only needs the fields it actually uses. Dropping the dead fields also lets the #[allow(dead_code)] go, so the lint stays honest for the rest of the struct.

Verification

cargo clippy --target wasm32-unknown-unknown is clean with the allow removed (confirming connection_id and prefix are both still used). Full pre-push suite green.

Found via ponytail over-engineering audit.

🤖 Generated with Claude Code

storage_type and is_primary were deserialized but never read — the
struct carried an #[allow(dead_code)] to hide them. serde ignores
unknown JSON fields by default, so the fields (and the allow) can go.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Claude finished @alukach's task in 18s —— View job


✅ No blocking issues — safe to merge.

  • src/registry.rs:259 — Clean removal. serde correctly ignores unknown fields by default, so dropping storage_type and is_primary won't break deserialization if the API still returns them. The #[allow(dead_code)] suppression going away is the right outcome, not a side effect.
  • No other references to storage_type, is_primary, or the removed fields found anywhere in src/.

@github-actions

Copy link
Copy Markdown

🚀 Latest commit deployed to https://source-data-proxy-pr-159.source-coop.workers.dev

  • Date: 2026-06-18T23:37:28Z
  • Commit: ee02bbc

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant