]> git.lizzy.rs Git - rust.git/commitdiff
Call wrap_str to make sure that the formatting macro body worked
authortopecongiro <seuchida@gmail.com>
Thu, 22 Feb 2018 23:13:57 +0000 (08:13 +0900)
committertopecongiro <seuchida@gmail.com>
Thu, 22 Feb 2018 23:13:57 +0000 (08:13 +0900)
rustfmt-core/src/macros.rs

index 1d40efb9b3a1d92135c974852eed2a36c4b839b0..280a1856b50854ad74dd578b7cafc0a003d3b040 100644 (file)
@@ -38,7 +38,7 @@
 use lists::{itemize_list, write_list, ListFormatting};
 use rewrite::{Rewrite, RewriteContext};
 use shape::{Indent, Shape};
-use utils::{format_visibility, mk_sp};
+use utils::{format_visibility, mk_sp, wrap_str};
 
 const FORCED_BRACKET_MACROS: &[&str] = &["vec!"];
 
@@ -810,6 +810,7 @@ fn rewrite(
                 None => return None,
             },
         };
+        let new_body = wrap_str(new_body, config.max_width(), shape)?;
 
         // Indent the body since it is in a block.
         let indent_str = body_indent.to_string(&config);