#93 Remove wildcard imports (in particular super::*)

Merged
nutomic merged 1 commits from remove-wildcard-imports into main 6 months ago
nutomic commented 6 months ago
Owner

These are annoying because its hard to see what is actually imported by a particular file. I thought I already did this before, but maybe that was only for database code? Anyway it would be nice to have a lint so we dont get the same thing in again in the future. There is clippy::wildcard_imports, but unfortunately that one is way too strict. Maybe we could just grep for use super::* in our CI and fail if that appears anywhere?

These are annoying because its hard to see what is actually imported by a particular file. I thought I already did this before, but maybe that was only for database code? Anyway it would be nice to have a lint so we dont get the same thing in again in the future. There is [clippy::wildcard_imports](https://rust-lang.github.io/rust-clippy/stable/index.html#wildcard_imports), but unfortunately that one is way too strict. Maybe we could just grep for `use super::*` in our CI and fail if that appears anywhere?
Poster
Owner

Probably might need a grep for the character * in general.

Probably might need a grep for the character `*` in general.
Poster
Owner

I don't know if its really worth it, there's ~100 of them, and many of them like prelude::* seem to be the preferred way to do it.

I don't know if its really worth it, there's ~100 of them, and many of them like `prelude::*` seem to be the preferred way to do it.
nutomic commented 6 months ago
Poster
Owner

I only want to get rid of use super::*, nothing else. I agree with you that getting rid of all wildcard imports would be a waste of time. There is a clippy lint for wildcard imports in general (the one I linked above), but not for the super::*.

I only want to get rid of `use super::*`, nothing else. I agree with you that getting rid of all wildcard imports would be a waste of time. There is a clippy lint for wildcard imports in general (the one I linked above), but not for the `super::*`.
Poster
Owner

Ah gotcha.

Ah gotcha.
nutomic merged commit 5d64dfd4dc into main 6 months ago
The pull request has been merged as 5d64dfd4dc.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.