mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
Increase the max width by tab width when using format_code_block
since the macro body will be surrounded by fn main block.
This commit is contained in:
parent
9a5a86164f
commit
b318e5a684
@ -1285,10 +1285,14 @@ impl MacroBranch {
|
||||
// First try to format as items, then as statements.
|
||||
let new_body = match ::format_snippet(&body_str, &config) {
|
||||
Some(new_body) => new_body,
|
||||
None => match ::format_code_block(&body_str, &config) {
|
||||
Some(new_body) => new_body,
|
||||
None => return None,
|
||||
},
|
||||
None => {
|
||||
let new_width = new_width + config.tab_spaces();
|
||||
config.set().max_width(new_width);
|
||||
match ::format_code_block(&body_str, &config) {
|
||||
Some(new_body) => new_body,
|
||||
None => return None,
|
||||
}
|
||||
}
|
||||
};
|
||||
let new_body = wrap_str(new_body, config.max_width(), shape)?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user