-
Couldn't load subscription status.
- Fork 962
Open
Labels
C-discussionCategory: discussionCategory: discussionUO-group_importsUnstable option: group_importsUnstable option: group_imports
Description
In Rust, you can write imports inside of function bodies. This is usually used for one or a small few imports that are relevant to that function. There is a clear distinction between these two kinds of places in the Rust AST (items vs. statements) so I think it may be reasonable to have different rules in how they are handled.
My concern is that, since the number of imports inside of function bodes is usually small, group_imports will often result in separating two or three imports with blank lines, and this will feel noisy.
(Contrived) example:
fn my_function(thing: Bar) {
use std::collections::hash_map::Entry::*;
use foo::Bar::*;
match thing {
Sally(..) => ..,
Sammy(..) => ..,vs.
fn my_function(thing: Bar) {
use std::collections::hash_map::Entry::*;
use foo::Bar::*;
match thing {
Sally(..) => ..,
Sammy(..) => ..,Metadata
Metadata
Assignees
Labels
C-discussionCategory: discussionCategory: discussionUO-group_importsUnstable option: group_importsUnstable option: group_imports