Skip to content

Commit 2fc37ca

Browse files
authored
Consolidate util and utils (#4328)
1 parent 22ecd89 commit 2fc37ca

File tree

5 files changed

+223
-234
lines changed

5 files changed

+223
-234
lines changed

src/formatting.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ mod vertical;
5757
pub(crate) mod visitor;
5858

5959
pub(crate) mod report;
60-
pub(crate) mod util;
6160

6261
pub(crate) fn format_input_inner(
6362
input: Input,

src/formatting/comment.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::formatting::{
1111
shape::{Indent, Shape},
1212
string::{rewrite_string, StringFormat},
1313
utils::{
14-
count_newlines, first_line_width, last_line_width, tab_to_spaces,
14+
count_newlines, first_line_width, format_code_block, last_line_width, tab_to_spaces,
1515
trim_end_unless_two_whitespaces, trim_left_preserve_layout, unicode_str_width,
1616
},
1717
};
@@ -685,10 +685,7 @@ impl<'a> CommentRewrite<'a> {
685685
let mut config = self.fmt.config.clone();
686686
config.set().wrap_comments(false);
687687
if config.format_code_in_doc_comments() {
688-
if let Some(s) = crate::formatting::util::format_code_block(
689-
&self.code_block_buffer,
690-
&config,
691-
) {
688+
if let Some(s) = format_code_block(&self.code_block_buffer, &config) {
692689
trim_custom_comment_prefix(s.as_ref())
693690
} else {
694691
trim_custom_comment_prefix(&self.code_block_buffer)

src/formatting/macros.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ use crate::formatting::{
3333
shape::{Indent, Shape},
3434
source_map::SpanUtils,
3535
spanned::Spanned,
36-
util::{format_code_block, format_snippet},
3736
utils::{
38-
count_newlines, format_visibility, indent_next_line, is_empty_line, mk_sp,
39-
remove_trailing_white_spaces, rewrite_ident, trim_left_preserve_layout, wrap_str,
40-
NodeIdExt,
37+
count_newlines, format_code_block, format_snippet, format_visibility, indent_next_line,
38+
is_empty_line, mk_sp, remove_trailing_white_spaces, rewrite_ident,
39+
trim_left_preserve_layout, wrap_str, NodeIdExt,
4140
},
4241
visitor::FmtVisitor,
4342
};

src/formatting/util.rs

Lines changed: 0 additions & 224 deletions
This file was deleted.

0 commit comments

Comments
 (0)