Skip to content

core::fmt::Formatter needs setter methods #62731

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

Closed
Lokathor opened this issue Jul 16, 2019 · 1 comment
Closed

core::fmt::Formatter needs setter methods #62731

Lokathor opened this issue Jul 16, 2019 · 1 comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@Lokathor
Copy link
Contributor

If you're given a format string when formatting a struct there's no way to

  1. read some of that data
  2. decide how to format the struct fields.
  3. have those fields then format themselves according to an alternate Formatter based on your decision above.

Example: if you get a width argument, you can't use some of the width space yourself and then tell an inner field to format itself with a smaller width value because you used some of it.

So Formatter should get methods to change its configuration for things that are safe to change (width, alternate flag, precision, etc)

@estebank estebank added C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jul 16, 2019
@Mark-Simulacrum
Copy link
Member

Closing in favor of #19207.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants