You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my opinion, rustfmt should rewrite use std::io::{self}; to use std::io;. use std::io::{self}; can sometimes be left over after removing other imports. If you for example (automatically) import std::io and std::io::Read (with rust-analyzer) and then remove the Read import, use std::io::{self}; is left behind.
The text was updated successfully, but these errors were encountered:
duplicate of #6129 and other similar issues. rustfmt doesn't perform the conversion because use std::io::{self}; and use std::io; are semantically different.
Would it be possible to have rustfmt figure out if they both refer to the same thing and only then rewrite it?
Nope. Well more precisely, there's technically a universe in which it could be done but it's note remotely feasible and it's behavior that the tools avoid for good reason (rustfix won't apply this transformation either for the same underlying reasons)
In my opinion, rustfmt should rewrite
use std::io::{self};
touse std::io;
.use std::io::{self};
can sometimes be left over after removing other imports. If you for example (automatically) importstd::io
andstd::io::Read
(with rust-analyzer) and then remove theRead
import,use std::io::{self};
is left behind.The text was updated successfully, but these errors were encountered: