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

Manually merged
nutomic merged 1 commits from remove-wildcard-imports into main 2020-09-01 21:47:35 +00:00
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?
Owner

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

Probably might need a grep for the character `*` in general.
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.
Author
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::*`.
Owner

Ah gotcha.

Ah gotcha.
nutomic manually merged commit 5d64dfd4dc into main 2020-09-01 21:47:35 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: LemmyNet/lemmy#93
No description provided.