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
Currently rustfmt is able to simplify use path::to::module::self (which happens to be invalid syntax) into use path::to::module, and also to simplify use path::to::sub::{module} into use path::to::sub::module.
I want to suggest, based on these observations, that use path::to::module::{self} should simplify into use path::to::module.
A bigger example, using rustfmt 1.4.38-stable (e092d0b 2022-07-16):
use path::to::module::self (which happens to be invalid syntax)
rustfmt works at the AST level, so the code only needs to be parseable in order for rustfmt to be able to operate, even if that parsed code will be failed by later stages of the compiler.
Currently rustfmt is able to simplify
use path::to::module::self
(which happens to be invalid syntax) intouse path::to::module
, and also to simplifyuse path::to::sub::{module}
intouse path::to::sub::module
.I want to suggest, based on these observations, that
use path::to::module::{self}
should simplify intouse path::to::module
.A bigger example, using
rustfmt 1.4.38-stable (e092d0b 2022-07-16)
:Before:
After:
Proposed:
The text was updated successfully, but these errors were encountered: