|
| 1 | +// rustfmt-version: Two |
| 2 | +// rustfmt-format_macro_matchers: true |
| 3 | + |
| 4 | +// From original issue example - Line length 101 |
| 5 | +macro_rules! test { |
| 6 | +($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeio:expr, $add:expr) => {{ |
| 7 | +return; |
| 8 | +}}; |
| 9 | +} |
| 10 | + |
| 11 | +// Spaces between the `{` and `}` |
| 12 | +macro_rules! test { |
| 13 | +($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeio:expr, $add:expr) => { { |
| 14 | +return; |
| 15 | +} }; |
| 16 | +} |
| 17 | + |
| 18 | +// Multi `{}` |
| 19 | +macro_rules! test { |
| 20 | +($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeio:expr, $add:expr) => {{{{ |
| 21 | +return; |
| 22 | +}}}}; |
| 23 | +} |
| 24 | + |
| 25 | +// Multi `{}` with spaces |
| 26 | +macro_rules! test { |
| 27 | +($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeio:expr, $add:expr) => { { { { |
| 28 | +return; |
| 29 | +} } } }; |
| 30 | +} |
| 31 | + |
| 32 | +// Line length 102 |
| 33 | +macro_rules! test { |
| 34 | +($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeiou:expr, $add:expr) => {{ |
| 35 | +return; |
| 36 | +}}; |
| 37 | +} |
| 38 | + |
| 39 | +// Line length 103 |
| 40 | +macro_rules! test { |
| 41 | +($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeioua:expr, $add:expr) => {{ |
| 42 | +return; |
| 43 | +}}; |
| 44 | +} |
| 45 | + |
| 46 | +// With extended macro body - Line length 101 |
| 47 | +macro_rules! test { |
| 48 | +($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeio:expr, $add:expr) => {{ |
| 49 | +let VAR = "VALUE"; return VAR; |
| 50 | +}}; |
| 51 | +} |
| 52 | + |
| 53 | +// With extended macro body - Line length 102 |
| 54 | +macro_rules! test { |
| 55 | +($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeiou:expr, $add:expr) => {{ |
| 56 | +let VAR = "VALUE"; return VAR; |
| 57 | +}}; |
| 58 | +} |
| 59 | + |
| 60 | +// With extended macro body - Line length 103 |
| 61 | +macro_rules! test { |
| 62 | +($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeioua:expr, $add:expr) => {{ |
| 63 | +let VAR = "VALUE"; return VAR; |
| 64 | +}}; |
| 65 | +} |
0 commit comments