Skip to content

chore: Implement FusedIterator and size_hint for the shp iterators - #325

Open
CommanderStorm wants to merge 2 commits into
mainfrom
iterator-traits
Open

chore: Implement FusedIterator and size_hint for the shp iterators#325
CommanderStorm wants to merge 2 commits into
mainfrom
iterator-traits

Conversation

@CommanderStorm

@CommanderStorm CommanderStorm commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Also impl ExactSizeIterator + FusedIterator for the iterators that can.
ALso add size_hint for the things that need

@michaelkirk michaelkirk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good - but I was confused by one part.

Comment thread geozero/src/shp/reader.rs Outdated
}
let (shapes_lower, shapes_upper) = self.shape_iter.size_hint();
let num_records = self.dbf_reader.header().num_records as usize;
// Reading past the last dbf record yields one final error item

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused by this comment - but assume it's related to the saturating_add(1)? Can you add a test for this code path?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, was an halucination, I did not yet fully clean up the PR when you reviewed it

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@CommanderStorm CommanderStorm changed the title Implement FusedIterator and size_hint for the shp iterators chore: Implement FusedIterator and size_hint for the shp iterators Aug 1, 2026
clippy::manual_midpoint is pedantic-level and CI runs clippy with
-D warnings, so the manual (a + b) / 2 broke the docs job.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0111ASd1ug96t8CixgGsaoHL
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.

2 participants