microsoft / windows-rs

Rust for Windows
https://kennykerr.ca/rust-getting-started/
Apache License 2.0
10.13k stars 473 forks source link

`impl Default for OFSTRUCT` and other similar structs #3058

Closed anforowicz closed 1 month ago

anforowicz commented 1 month ago

Suggestion

AFAIU the OFSTRUCT struct doesn't implement the Default trait. This means that the user of the struct is forced to spell out all the struct fields during initialization, including Reserved1 and Reserved2, as well as cBytes. Would it be possible to have the Default impl provided by the windows-sys crate?

kennykerr commented 1 month ago

The windows-sys crate provides a minimal set of traits to minimize build time. The windows create does however provide such traits for this struct.

https://kennykerr.ca/rust-getting-started/windows-or-windows-sys.html