domain: ConfirmationDetails is a dead empty struct plumbed through every construction site #67

Open
opened 2026-07-03 01:43:17 +00:00 by rosa · 0 comments
Owner

Found during a code review of the domain crate.

Location: crates/domain/src/models/user.rs:386 (struct), user.rs:505 (getter)
Type: Cleanup — dead code

Problem

ConfirmationDetails is an empty unit struct stored as a field on Confirmation, plumbed through Confirmation::new by every constructor (infra, mocks, tests), with a details() getter that has zero callers. The Postgres row mapping constructs ConfirmationDetails {} from thin air, so it carries no serialized meaning.

Cost

Every construction site must supply a value carrying no information, and the dead getter implies a meaning that is not there.

Suggested fix

Delete the struct, field, getter, and constructor parameter; reintroduce a real details type only when a confirmation action needs a payload.

Found during a code review of the `domain` crate. **Location:** `crates/domain/src/models/user.rs:386` (struct), `user.rs:505` (getter) **Type:** Cleanup — dead code ## Problem `ConfirmationDetails` is an empty unit struct stored as a field on `Confirmation`, plumbed through `Confirmation::new` by every constructor (infra, mocks, tests), with a `details()` getter that has zero callers. The Postgres row mapping constructs `ConfirmationDetails {}` from thin air, so it carries no serialized meaning. ## Cost Every construction site must supply a value carrying no information, and the dead getter implies a meaning that is not there. ## Suggested fix Delete the struct, field, getter, and constructor parameter; reintroduce a real details type only when a confirmation action needs a payload.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rosa/vernier#67
No description provided.