Skip to content

[NFC] Remove redundant DependencyResolver protocol #7127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

MaxDesiatov
Copy link
Contributor

@MaxDesiatov MaxDesiatov commented Nov 27, 2023

Motivation:

This protocol doesn't define any requirements and was used for nemaspacing a single tuple typealias. Instead of typealiasing this fairly complex and pervasively used tuple, we should define a separate struct for it. Then the protocol itself can be removed as completely unused.

Modifications:

Defined new struct DependencyResolverBinding with cleanly named fields, which now avoids tautological expressions that look like binding.binding and also avoids re-declaration of this tuple type explicitly in multiple places.

One other typealias in protocol DependencyResolver is unused, thus the whole protocol is unused and now can be removed.

Also used this as an opportunity to clean up file naming and directory layout in the PackageGraph module.

Result:

This confusing protocol is removed from the codebase. Readability is improved with explicit struct field names instead of ad-hoc tuple use. Directory layout makes it more obvious the purpose of specific files for potential new contributors and for existing contributors when reviewing code retrospectively.

This protocol doesn't define any requirements and was used for nemaspacing a single tuple typealias. Instead of typealiasing this fairly complex and pervasively used tuple, we should define a separate struct for it. Then the protocol itself can be removed as completely unused.

Also used this as an opportunity to clean up file naming and directory layout in the `PackageGraph` module.
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov MaxDesiatov self-assigned this Nov 27, 2023
@MaxDesiatov MaxDesiatov added the no functional change No user-visible functional changes included label Nov 27, 2023
@MaxDesiatov MaxDesiatov enabled auto-merge (squash) November 28, 2023 00:25
@MaxDesiatov MaxDesiatov merged commit 211be8c into main Nov 30, 2023
@MaxDesiatov MaxDesiatov deleted the maxd/cleanup-dependency-resolver branch November 30, 2023 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no functional change No user-visible functional changes included
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants