Skip to content

Improve encapsulation of ParsedSpans struct #52

@coderabbitai

Description

@coderabbitai

The ParsedSpans struct currently exposes all fields as public, which allows external mutation and breaks encapsulation principles. This makes it difficult to maintain invariants (such as sorted and non-overlapping spans) and complicates future extensions without breaking changes.

The struct should be refactored to:

  • Make fields private
  • Provide a public constructor method
  • Expose read-only access through getter methods
  • Consider adding #[non_exhaustive] for future extensibility

This issue was raised during code review and requested to be tracked separately.

References:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions