Skip to content

Fix bug in rewrite_tup_lit #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2015
Merged

Fix bug in rewrite_tup_lit #132

merged 1 commit into from
Jul 15, 2015

Conversation

cassiersg
Copy link
Contributor

Wasn't using all width available when the lenght is more than 1.

Wasn't using all width available when the lenght is more than 1.
// In case of length 1, need a trailing comma
if items.len() == 1 {
// 3 = "(" + ",)"
return items[0].rewrite(context, width - 3, indent).map(|s| format!("({},)", s));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think indent should be +1 to take account of the opening paren

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent is already offset + 1 (line 243).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sweet

nrc added a commit that referenced this pull request Jul 15, 2015
@nrc nrc merged commit 337c5b5 into rust-lang:master Jul 15, 2015
@cassiersg cassiersg deleted the fix-tup-lit branch August 27, 2015 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants