Skip to content

Implement TryFrom for ref of reader#133

Merged
JonoPrest merged 2 commits into
mainfrom
jp/impl-tryfrom-ref-reader
Jun 22, 2026
Merged

Implement TryFrom for ref of reader#133
JonoPrest merged 2 commits into
mainfrom
jp/impl-tryfrom-ref-reader

Conversation

@JonoPrest

@JonoPrest JonoPrest commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

When you want to materialize a real reader into a simple type, it's quite annoying because you always have a ref to a reader tied to a lifetime of the arrow batch rather than ownership. A small refactor allows you to use TryFrom for both Reader and &'a Reader

@JonoPrest JonoPrest requested a review from JasoonS June 22, 2026 15:37
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8f6cf4c1-dcc2-474d-947b-00457e73b5ad

📥 Commits

Reviewing files that changed from the base of the PR and between 913a6f1 and a4b0ddd.

📒 Files selected for processing (2)
  • hypersync-client/Cargo.toml
  • hypersync-client/src/from_arrow.rs

📝 Walkthrough

Walkthrough

Owned-reader TryFrom implementations for Log, Block, Transaction, and Trace in from_arrow.rs are refactored to delegate to their borrowed-reader counterparts (Type::try_from(&reader)), removing duplicate field-extraction logic. The crate version in Cargo.toml is bumped from 1.3.0 to 1.4.0.

Changes

Arrow Reader Delegation and Version Bump

Layer / File(s) Summary
Owned-reader TryFrom delegation
hypersync-client/src/from_arrow.rs
TryFrom<LogReader<'_>>, TryFrom<BlockReader<'_>>, TryFrom<TransactionReader<'_>>, and TryFrom<TraceReader<'_>> now each delegate to the corresponding borrowed-reader impl via Type::try_from(&reader) instead of duplicating field extraction.
Crate version bump
hypersync-client/Cargo.toml
Package version incremented from 1.3.0 to 1.4.0.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Implement TryFrom for ref of reader' accurately describes the main change: delegating owned-reader TryFrom implementations to call borrowed-reader TryFrom implementations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands and usage tips.

@JonoPrest JonoPrest requested a review from DZakh June 22, 2026 15:45
@JonoPrest JonoPrest merged commit 9c60b90 into main Jun 22, 2026
7 checks passed
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