Skip to content

Commit 5ccc23f

Browse files
committed
Call wrap_str to make sure that the formatting macro body worked
1 parent cb0097f commit 5ccc23f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rustfmt-core/src/macros.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use expr::{rewrite_array, rewrite_call_inner};
3838
use lists::{itemize_list, write_list, ListFormatting};
3939
use rewrite::{Rewrite, RewriteContext};
4040
use shape::{Indent, Shape};
41-
use utils::{format_visibility, mk_sp};
41+
use utils::{format_visibility, mk_sp, wrap_str};
4242

4343
const FORCED_BRACKET_MACROS: &[&str] = &["vec!"];
4444

@@ -810,6 +810,7 @@ impl MacroBranch {
810810
None => return None,
811811
},
812812
};
813+
let new_body = wrap_str(new_body, config.max_width(), shape)?;
813814

814815
// Indent the body since it is in a block.
815816
let indent_str = body_indent.to_string(&config);

0 commit comments

Comments
 (0)