Skip to content
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

Use builder pattern for ListFormatting #2890

Merged

Conversation

topecongiro
Copy link
Contributor

This PR introduces builder pattern for constructing ListFormatting. This greatly simplifies the code, but more importantly, I think that this makes the further updates and refactoring much easier.

r? @nrc

Copy link
Member

@nrc nrc left a comment

Choose a reason for hiding this comment

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

Looks good other than the question about pub(self)

src/lists.rs Outdated
pub trailing_separator: SeparatorTactic,
pub separator_place: SeparatorPlace,
pub shape: Shape,
pub(self) tactic: DefinitiveListTactic,
Copy link
Member

Choose a reason for hiding this comment

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

Why use pub(self) here? Is it not the same as private?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah you are right...not sure what I was thinking at the moment 😁

1a6df18 Fixed.

@nrc nrc merged commit f6a76c4 into rust-lang:master Aug 6, 2018
@topecongiro topecongiro deleted the use-builder-pattern-for-ListFormatting branch August 6, 2018 08:16
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