[review] rename internal function
This commit is contained in:
parent
ba0351a146
commit
9b1b3d6955
@ -183,7 +183,7 @@ fn from_path_segment(
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn regroup_use_trees(
|
||||
pub(crate) fn normalize_use_trees_with_granularity(
|
||||
use_trees: Vec<UseTree>,
|
||||
import_granularity: ImportGranularity,
|
||||
) -> Vec<UseTree> {
|
||||
@ -1125,7 +1125,10 @@ macro_rules! parse_use_trees {
|
||||
macro_rules! test_merge {
|
||||
($by:ident, [$($input:expr),* $(,)*], [$($output:expr),* $(,)*]) => {
|
||||
assert_eq!(
|
||||
regroup_use_trees(parse_use_trees!($($input,)*), ImportGranularity::$by),
|
||||
normalize_use_trees_with_granularity(
|
||||
parse_use_trees!($($input,)*),
|
||||
ImportGranularity::$by,
|
||||
),
|
||||
parse_use_trees!($($output,)*),
|
||||
);
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
use rustc_span::{symbol::sym, Span};
|
||||
|
||||
use crate::config::{Config, GroupImportsTactic};
|
||||
use crate::imports::{regroup_use_trees, UseSegment, UseTree};
|
||||
use crate::imports::{normalize_use_trees_with_granularity, UseSegment, UseTree};
|
||||
use crate::items::{is_mod_decl, rewrite_extern_crate, rewrite_mod};
|
||||
use crate::lists::{itemize_list, write_list, ListFormatting, ListItem};
|
||||
use crate::rewrite::RewriteContext;
|
||||
@ -107,8 +107,10 @@ fn rewrite_reorderable_or_regroupable_items(
|
||||
for (item, list_item) in normalized_items.iter_mut().zip(list_items) {
|
||||
item.list_item = Some(list_item.clone());
|
||||
}
|
||||
normalized_items =
|
||||
regroup_use_trees(normalized_items, context.config.imports_granularity());
|
||||
normalized_items = normalize_use_trees_with_granularity(
|
||||
normalized_items,
|
||||
context.config.imports_granularity(),
|
||||
);
|
||||
|
||||
let mut regrouped_items = match context.config.group_imports() {
|
||||
GroupImportsTactic::Preserve | GroupImportsTactic::One => {
|
||||
|
Loading…
Reference in New Issue
Block a user