Skip to content

Simplify use std::io::{self}; #6415

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

Closed
iago-lito opened this issue Dec 11, 2024 · 1 comment
Closed

Simplify use std::io::{self}; #6415

iago-lito opened this issue Dec 11, 2024 · 1 comment

Comments

@iago-lito
Copy link

I sometimes end up with this kind of dummy import lines:

use std::io::{self};

Maybe rustfmt could simplify it into:

use std::io;

?

@ytmimi
Copy link
Contributor

ytmimi commented Dec 11, 2024

@iago-lito This has come up before. My understanding is that there are semantic differences between use std::io::{self}; and use std::io;, so rustfmt can't safely make that change without potentially breaking your code. See #3568 and other linked issues.

@ytmimi ytmimi closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants