Simplify codebase: extract shared helpers and reduce duplication#13
Merged
Simplify codebase: extract shared helpers and reduce duplication#13
Conversation
- Strip `default-features` from member deps when converting to
`{ workspace = true }` since it must be set at the workspace level
- Scan target-specific dep sections when checking for default-features
- Add target_deps fixture and tests for target-specific dependencies
- Remove unused DepSection enum, Display impl, and section field from MemberDep - Remove unused path field from MemberCrate - Move DEP_SECTIONS to workspace.rs as pub(crate), import in fix.rs - Rename read_toml to read_file in tests (it reads strings, not parsed TOML)
workspace.rs was using the toml crate for read-only parsing while fix.rs used toml_edit for format-preserving edits. Since toml is just a wrapper around toml_edit, consolidate on toml_edit as the single TOML library.
- Add read_manifest, item_as_table_like, for_each_dep_table helpers - Merge two member loops in check.rs into one - Deduplicate fixture() test helper - Remove TOCTOU exists() check in expand_members
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.
Extract shared helpers (
read_manifest,item_as_table_like,for_each_dep_table) and remove duplicated code across modules.