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]: bound types on Debug #477

Open
derekdreery opened this issue Dec 8, 2021 · 1 comment
Open

[feature request]: bound types on Debug #477

derekdreery opened this issue Dec 8, 2021 · 1 comment

Comments

@derekdreery
Copy link
Collaborator

It would occasionally help debugging very much if RenderContext, Text, TextLayoutBuilder, TextLayout, Image etc. were all bounded by Debug, so when e.g. you're retaining them in a struct you can just derive(Debug).

@cmyr
Copy link
Member

cmyr commented Dec 8, 2021

Yes this is reasonable request.

Do we expect these impls to be useful?

In any case I see two options: we can add these bounds to the trait (trait Text: Debug) or we can make this an informal contract for things reexported by piet-common, and just have a test in piet-common that checks that Debug is impl'd for these types, like:

fn check_debug<T: Debug>() {};

#[test]
fn ensure_debug() {
    check_debug::<PietText>();
   // etc
}

I have some sort of emotional preference for not having this be a bound on the traits, but I'm not sure where that comes from honestly.

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

2 participants