Skip to content
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

Inline predule module contents into their parent modules #972

Merged
merged 1 commit into from
Dec 8, 2024

Conversation

MarijnS95
Copy link
Collaborator

@MarijnS95 MarijnS95 commented Dec 7, 2024

We've never used prelude in a sensible way, both modules inside the crate root and vk namespace have always abused these modules to store a random combination of private utilities next to a few extra hand-written type/trait definitions and implementations, as outlined before in #879 (comment).

Neither of these need to glob-imported by users to make easy use of ash functionality besides perhaps ensuring traits like Handle and TaggedStructure are in scope. Their glob imports were only useful to ash itself, and even then the vk::prelude was already fully glob-reexported in vk.

Besides inlining its contents, I've shuffled some private helpers like debug_flags() closer to where they are being used.

@MarijnS95 MarijnS95 requested a review from Ralith December 7, 2024 00:41
@MarijnS95 MarijnS95 force-pushed the rm-prelude branch 3 times, most recently from 4f41c00 to 96eeda9 Compare December 7, 2024 00:56
ash/src/vk.rs Outdated Show resolved Hide resolved
generator/src/lib.rs Show resolved Hide resolved
We've never used `prelude` in a sensible way, both modules inside
the crate root and `vk` namespace have always abused these modules to
store a random combination of private utilities next to a few extra
hand-written type/trait definitions and implementations.

Neither of these need to glob-imported by users to make easy use of
`ash` functionality besides perhaps ensuring traits like `Handle` and
`TaggedStructure` are in scope.  Their glob imports were only useful
to `ash` itself, and even then the `vk::prelude` was already fully
glob-reexported in `vk`.

Besides inlining its contents, I've shuffled some private helpers like
`debug_flags()` closer to where they are being used.
Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tidying this up! Been irritating me for years.

@MarijnS95
Copy link
Collaborator Author

Thanks for tidying this up! Been irritating me for years.

Any time 🎉

@MarijnS95 MarijnS95 merged commit 8b0d4c5 into master Dec 8, 2024
20 checks passed
@MarijnS95 MarijnS95 deleted the rm-prelude branch December 8, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants