Replace into_inner() with into() for nutype domain types #245

Closed
opened 2025-12-28 20:00:15 -08:00 by jwilger · 1 comment
jwilger commented 2025-12-28 20:00:15 -08:00 (Migrated from github.com)

Background

Currently we call .into_inner() on nutype domain types when we need the wrapped primitive value. This is verbose and non-idiomatic. Rust's Into trait is the standard way to perform type conversions.

Changes

  1. Find all locations where .into_inner() is called on nutype types
  2. Implement Into<T> for each nutype domain type (BatchSize, StreamPosition, StreamVersion, etc.)
  3. Replace .into_inner() calls with .into()
  4. Ensure tests pass and code compiles

Example

// Current (verbose)
let size: usize = batch_size.into_inner();

// After (idiomatic)
let size: usize = batch_size.into();

Acceptance Criteria

  • Into<T> implemented for all nutype domain types
  • All .into_inner() calls replaced with .into()
  • Existing test suite passes unchanged
  • More idiomatic Rust code

Migrated from beads issue: eventcore-4i0

## Background Currently we call `.into_inner()` on nutype domain types when we need the wrapped primitive value. This is verbose and non-idiomatic. Rust's `Into` trait is the standard way to perform type conversions. ## Changes 1. Find all locations where `.into_inner()` is called on nutype types 2. Implement `Into<T>` for each nutype domain type (BatchSize, StreamPosition, StreamVersion, etc.) 3. Replace `.into_inner()` calls with `.into()` 4. Ensure tests pass and code compiles ## Example ```rust // Current (verbose) let size: usize = batch_size.into_inner(); // After (idiomatic) let size: usize = batch_size.into(); ``` ## Acceptance Criteria - [ ] `Into<T>` implemented for all nutype domain types - [ ] All `.into_inner()` calls replaced with `.into()` - [ ] Existing test suite passes unchanged - [ ] More idiomatic Rust code --- *Migrated from beads issue: eventcore-4i0*
jwilger-ai-bot commented 2026-04-11 17:15:07 -07:00 (Migrated from github.com)

Completed in #334 — added Into derives and domain operations to nutype types.

Completed in #334 — added Into derives and domain operations to nutype types.
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
jwilger/eventcore#245
No description provided.