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

Support custom format on item for Debug derive macro #277

Closed
ModProg opened this issue Jul 25, 2023 · 4 comments · Fixed by #279
Closed

Support custom format on item for Debug derive macro #277

ModProg opened this issue Jul 25, 2023 · 4 comments · Fixed by #279
Assignees
Milestone

Comments

@ModProg
Copy link
Contributor

ModProg commented Jul 25, 2023

I.e. something like:

#[derive(Debug)]
#[debug("{name}={value:?}")]
struct Arg {
  name: String,
  value: String
}
@JelteF
Copy link
Owner

JelteF commented Jul 25, 2023

Does this still not work with v1.0.0-beta.2?

@ModProg
Copy link
Contributor Author

ModProg commented Jul 25, 2023

AFAICT it only works with Display

@tyranron
Copy link
Collaborator

@JelteF we have this on fields level for Debug, but missing on item level.

@tyranron tyranron added this to the 1.0.0 milestone Jul 26, 2023
JelteF pushed a commit that referenced this issue Aug 5, 2023
Adds support `debug` attributes on structs an enum variants like this:
```rs
#[derive(Debug)]
#[debug("{name}={value:?}")]
struct Arg {
  name: String,
  value: String
}
```

Before the `debug` attribute could only be used on fields of a struct or variant.

Resolves #277

---------

Co-authored-by: tyranron <tyranron@gmail.com>
@mightyiam
Copy link

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants