refactor: organize modules and make result types explicit - #49
Merged
Merged
Conversation
Keep each versioned golden file beside its encoding and decoding module. Preserve fixture bytes and keep only the shared parser and assertions in fixtures.rs.
Use imports for referenced symbols and start intra-crate paths at crate. Reserve parent glob imports for tests, and keep short qualifiers or explicit aliases where they clarify symbol origins. Document the conventions in CONTRIBUTING.md.
Use direct paths where aliases or conditional imports obscure symbol origins, retain conventional short qualifiers, and give rustdoc links concise labels with explicit targets.
Remove the public cache2::Result alias and the private recovery metadata Result alias. Name the error type at each return boundary, and update caller examples and migration notes while preserving the underlying error types.
Keep the workspace entry points, tool setup, validation commands, and lasting contribution requirements. Refer to existing code and source configuration for details.
Keep selective public exports at the crate root. Expose internal child modules through private parents and reference their definitions directly, removing redundant re-exports. Keep implementations used only by their parent module private.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
region; keep eviction inmemoryand file access and execution inio. Internal callers use owning modules, while the crate root selects public exports.IoEngineConfigand remove customResultaliases. Public callers use the standardResult<T, Error>withErrorimported fromcache2; examples and migration notes follow the final API.CONTRIBUTING.mdthe source of contribution rules, with a one-way link fromAGENTS.mdand design constraints inARCHITECTURE.md. Describe changelog entries relative to the latest release.Runtime behavior, concrete error types, and golden fixture bytes are unchanged.
Validation:
cargo +1.98.0 x check,cargo +1.98.0 x test(including doctests and extended library tests), andcargo +1.98.0 x lintall pass.