Skip to content

refactor: ember-persistence docs and test cleanup - #121

Merged
kacy merged 1 commit into
mainfrom
refactor/ember-persistence
Feb 14, 2026
Merged

refactor: ember-persistence docs and test cleanup#121
kacy merged 1 commit into
mainfrom
refactor/ember-persistence

Conversation

@kacy

@kacy kacy commented Feb 14, 2026

Copy link
Copy Markdown
Owner

summary

  • documents the capped_capacity function rationale in format.rs — explains
    why 65,536 was chosen as the cap and how it limits pre-allocation without
    capping iteration count
  • converts all test functions in snapshot.rs and aof.rs from unwrap() chains
    to Result return types with ? operator for cleaner failure output

what was tested

  • cargo test -p ember-persistence — all 67 tests pass
  • cargo check -p ember-persistence

design considerations

the type Result = std::result::Result<(), Box<dyn std::error::Error>> alias
is defined per test module to keep it local and avoid polluting the crate
namespace. tests that deliberately assert on error variants (like
corrupt_crc_detected) still use unwrap_err() since those are the actual
assertions being tested.

…ator

- format.rs: expand capped_capacity doc explaining the 65,536 cap choice
  and why it limits pre-allocation without capping iteration
- snapshot.rs: convert test functions from unwrap chains to Result + ?
  for cleaner failure output and more idiomatic test style
- aof.rs: same treatment for all test functions
@kacy
kacy merged commit 952b350 into main Feb 14, 2026
7 checks passed
@kacy
kacy deleted the refactor/ember-persistence branch February 14, 2026 21:48
kacy added a commit that referenced this pull request Feb 19, 2026
…ator (#121)

- format.rs: expand capped_capacity doc explaining the 65,536 cap choice
  and why it limits pre-allocation without capping iteration
- snapshot.rs: convert test functions from unwrap chains to Result + ?
  for cleaner failure output and more idiomatic test style
- aof.rs: same treatment for all test functions
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.

1 participant