refactor: migrate deps-cargo and deps-pypi from toml_edit to toml-span#69
Merged
refactor: migrate deps-cargo and deps-pypi from toml_edit to toml-span#69
Conversation
#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
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
Closes #65
deps-cargoanddeps-pypiTOML parsers fromtoml_edittotoml-spantoml-spanprovides reliableValue.spanfor all values including inline tables, eliminating text-search position fallbackstoml_editfrom workspace dependencies entirelyChanges
deps-cargo:
parser.rs: rewritten to usetoml_span::parse()withvalue.spanfor position trackinglockfile.rs: migrated fromDocumentMuttotoml_span::parse()error.rs:TomlParseErrorsource changed fromtoml_edit::TomlErrortoStringdeps-pypi:
parser.rs: rewritten, removedfind_dependency_string_positionandfind_table_key_positionworkaroundslockfile.rs: migrated fromDocumentMuttotoml_span::parse()error.rs:TomlParseErrorsource changed fromtoml_edit::TomlErrortoStringworkspace:
toml_editfrom[workspace.dependencies](all TOML parsers now usetoml-span)Test plan
cargo nextest run --workspace— 1144 tests pass, 33 skippedcargo clippy --workspace --all-targets --all-features -- -D warnings— cleancargo +nightly fmt --check— clean