I noticed that rustfmt does not reduce use foo::{self} or use foo::self to use foo. When I brought this up in an issue, I was told that the semantics vary between the two forms. I can't find any resource that talks about this - is anyone able to please explain what the difference is?
4 Likes
use foo imports foo for all three namespaces (macros, values, types) whereas use foo::{self} only imports foo from the types namespace.
15 Likes