Skip to content

fix(error)!: mark SacnError and ParsePacketError non-exhaustive - #129

Merged
stewartadam merged 2 commits into
mainfrom
claude/project-thread-tpi2pf-error-non-exhaustive
Nov 29, 2026
Merged

stewartadam merged 2 commits into
mainfrom
claude/project-thread-tpi2pf-error-non-exhaustive

Conversation

@stewartadam

Copy link
Copy Markdown
Contributor

Marks SacnError and ParsePacketError #[non_exhaustive], so new variants can be added later without a breaking release.

Why

Adding a variant to either enum is currently a breaking change, because callers may match on them exhaustively. #100 (network interface selection) works around this by reporting an unknown interface as SacnError::Io with ErrorKind::NotFound. Once this merges, #100 can use its own InterfaceNotFound variant instead.

Breaking change

Code outside the crate that matches on SacnError or ParsePacketError without a wildcard arm stops compiling and needs a _ => arm. Nothing else changes: no variant is added, removed or renamed. The title is marked ! so release-plz bumps the minor version (0.13).

AGENTS.md said that adding a SacnError variant needs a breaking release. I updated it.

E1.31

No protocol behaviour changes.

Tests

cargo test, Clippy, and cargo doc with -D warnings pass locally. The crate's own tests and examples needed no changes, since they only match specific variants or use wildcard arms already.


Generated by Claude Code

New error variants, such as one for a network interface that can't be
found, can then be added without a breaking release. Code outside the
crate that matches on either enum now needs a wildcard arm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KzaQVSfy9eXbfgqTKMEq7P
@stewartadam stewartadam self-assigned this Nov 27, 2026
@stewartadam
stewartadam enabled auto-merge (squash) November 29, 2026 06:40
@stewartadam
stewartadam disabled auto-merge November 29, 2026 06:40
@stewartadam
stewartadam enabled auto-merge (squash) November 29, 2026 06:40
@stewartadam
stewartadam merged commit 7c3b09b into main Nov 29, 2026
25 of 27 checks passed
@stewartadam
stewartadam deleted the claude/project-thread-tpi2pf-error-non-exhaustive branch November 29, 2026 06:42
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.

2 participants