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

Feature request: Add a way to display only part of a collection-like type #92

Open
dzfranklin opened this issue Mar 31, 2021 · 0 comments

Comments

@dzfranklin
Copy link

dzfranklin commented Mar 31, 2021

I want to indicate in the debug representation that a field contains Vec or slice and give a preview of what sort of data it contains without showing the whole slice. I propose an option like so

#[derivative(Debug=take(10))]
field: Vec<u8>

which translates to whatever the debug formatting of the following is

field.iter().take(10).collect::Vec<_>()

I'm happy to make a PR if this is something you're open to.

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

No branches or pull requests

1 participant