mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Move rewrite_mod to the items module
This commit is contained in:
parent
e8636afab2
commit
eb9cafb440
@ -124,16 +124,6 @@ pub fn rewrite_import(
|
||||
}
|
||||
}
|
||||
|
||||
/// Rewrite an inline mod.
|
||||
pub fn rewrite_mod(item: &ast::Item) -> String {
|
||||
let mut result = String::with_capacity(32);
|
||||
result.push_str(&*format_visibility(&item.vis));
|
||||
result.push_str("mod ");
|
||||
result.push_str(&item.ident.to_string());
|
||||
result.push(';');
|
||||
result
|
||||
}
|
||||
|
||||
impl<'a> FmtVisitor<'a> {
|
||||
pub fn format_imports(&mut self, use_items: &[&ast::Item]) {
|
||||
if use_items.is_empty() {
|
||||
|
@ -2845,3 +2845,13 @@ impl Rewrite for ast::GenericParam {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Rewrite an inline mod.
|
||||
pub fn rewrite_mod(item: &ast::Item) -> String {
|
||||
let mut result = String::with_capacity(32);
|
||||
result.push_str(&*format_visibility(&item.vis));
|
||||
result.push_str("mod ");
|
||||
result.push_str(&item.ident.to_string());
|
||||
result.push(';');
|
||||
result
|
||||
}
|
||||
|
@ -18,7 +18,8 @@ use config::lists::*;
|
||||
use syntax::{ast, codemap::Span};
|
||||
|
||||
use comment::combine_strs_with_missing_comments;
|
||||
use imports::{path_to_imported_ident, rewrite_import, rewrite_mod};
|
||||
use imports::{path_to_imported_ident, rewrite_import};
|
||||
use items::rewrite_mod;
|
||||
use lists::{itemize_list, write_list, ListFormatting};
|
||||
use rewrite::{Rewrite, RewriteContext};
|
||||
use shape::Shape;
|
||||
|
Loading…
Reference in New Issue
Block a user