Merge pull request #947 from marcusklaas/match-pattern-limit
Fix off-by-one error in pattern formatting
This commit is contained in:
commit
fe993dbdf3
3 changed files with 43 additions and 2 deletions
|
|
@ -76,8 +76,9 @@ impl Rewrite for Pat {
|
|||
if pat_vec.is_empty() {
|
||||
Some(path_str)
|
||||
} else {
|
||||
// 1 = (
|
||||
let width = try_opt!(width.checked_sub(path_str.len() + 1));
|
||||
// 2 = "()".len()
|
||||
let width = try_opt!(width.checked_sub(path_str.len() + 2));
|
||||
// 1 = "(".len()
|
||||
let offset = offset + path_str.len() + 1;
|
||||
let items = itemize_list(context.codemap,
|
||||
pat_vec.iter(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue