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

Remove braces for import only self #13310

Open
A4-Tacks opened this issue Aug 26, 2024 · 3 comments
Open

Remove braces for import only self #13310

A4-Tacks opened this issue Aug 26, 2024 · 3 comments
Labels
A-lint Area: New lints

Comments

@A4-Tacks
Copy link

What it does

Simplify the code

Advantage

  • Remove unnecessary braces

Drawbacks

No response

Example

use std::iter::{self};

Could be written as:

use std::iter;
@A4-Tacks A4-Tacks added the A-lint Area: New lints label Aug 26, 2024
@A4-Tacks A4-Tacks changed the title remove self once import braces Remove braces for import only self Aug 26, 2024
@nyurik
Copy link
Contributor

nyurik commented Sep 1, 2024

Should this be part of the fmt?

@lolbinarycat
Copy link

related: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_self_imports

@SpriteOvO
Copy link
Contributor

Link to issue rust-lang/rustfmt#3568

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints
Projects
None yet
Development

No branches or pull requests

5 participants
@nyurik @lolbinarycat @SpriteOvO @A4-Tacks and others