gtk-rs / gtk3-rs

Rust bindings for GTK 3
https://gtk-rs.org
MIT License
508 stars 90 forks source link

gtk/{Text,Tree}Iter: derive Debug #714

Closed fengalin closed 2 years ago

fengalin commented 2 years ago

So that a struct using these types can also auto derive Debug.

Another solution could be to add a Debug impl in manual code, but since these are iterators, there's not much we can show.

Other boxed_inline candidates in gtk-rs-core and gtk3-rs use manual Debug impl AFAICT.

GuillaumeGomez commented 2 years ago

I wonder if we should do the opposite and derive Debug by default unless set to false...

fengalin commented 2 years ago

I wonder if we should do the opposite and derive Debug by default unless set to false...

If I refer to graphen, which uses the most boxed_inlines AFAICT, it makes sense to manually implement. You would either get useless inner indirection or require to manually implement anyway to either call the C accessors or use the proper cast (see quad.rs for instance).

GuillaumeGomez commented 2 years ago

Good point. :)

cc @sdroege