Skip to content

refactor: migrate deps-cargo and deps-pypi from toml_edit to toml-span#69

Merged
bug-ops merged 1 commit intomainfrom
feature/toml-span-migration
Feb 23, 2026
Merged

refactor: migrate deps-cargo and deps-pypi from toml_edit to toml-span#69
bug-ops merged 1 commit intomainfrom
feature/toml-span-migration

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 23, 2026

Summary

Closes #65

  • Migrate deps-cargo and deps-pypi TOML parsers from toml_edit to toml-span
  • toml-span provides reliable Value.span for all values including inline tables, eliminating text-search position fallbacks
  • Remove toml_edit from workspace dependencies entirely
  • Net reduction of ~264 lines (497 deleted, 233 added)

Changes

deps-cargo:

  • parser.rs: rewritten to use toml_span::parse() with value.span for position tracking
  • lockfile.rs: migrated from DocumentMut to toml_span::parse()
  • error.rs: TomlParseError source changed from toml_edit::TomlError to String

deps-pypi:

  • parser.rs: rewritten, removed find_dependency_string_position and find_table_key_position workarounds
  • lockfile.rs: migrated from DocumentMut to toml_span::parse()
  • error.rs: TomlParseError source changed from toml_edit::TomlError to String

workspace:

  • Removed toml_edit from [workspace.dependencies] (all TOML parsers now use toml-span)

Test plan

  • cargo nextest run --workspace — 1144 tests pass, 33 skipped
  • cargo clippy --workspace --all-targets --all-features -- -D warnings — clean
  • cargo +nightly fmt --check — clean
  • All existing test expectations unchanged

#65)

Replace toml_edit with toml-span in both Cargo.toml and pyproject.toml
parsers. toml-span provides reliable span tracking for all values
including inline tables, eliminating text-search fallbacks for position
tracking.

- Rewrite deps-cargo parser to use toml_span::parse() with Value.span
- Rewrite deps-pypi parser, removing find_dependency_string_position
  and find_table_key_position workarounds
- Migrate lockfile parsers in both crates
- Remove toml_edit from workspace dependencies entirely
@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes parser Parser changes needs-review Needs review size: XL 500-1000 lines changed labels Feb 23, 2026
@bug-ops bug-ops enabled auto-merge (squash) February 23, 2026 01:01
@bug-ops bug-ops merged commit 97b7783 into main Feb 23, 2026
20 checks passed
@bug-ops bug-ops deleted the feature/toml-span-migration branch February 23, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation needs-review Needs review parser Parser changes rust Rust code changes size: XL 500-1000 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: migrate deps-cargo and deps-pypi from toml_edit to toml-span

1 participant