vk-rs icon indicating copy to clipboard operation
vk-rs copied to clipboard

Automatically derive Clone and Debug

Open kvark opened this issue 7 years ago • 1 comments

Currently, the implementations appear to be manually generated.

kvark avatar Feb 13 '18 16:02 kvark

This is intentional. Automatic derives are used in situations where they can be used, which is true of most structs. However, there are a couple cases where manual implementations are needed, because the underlying types don't directly implement the trait. The main case of this I can remember is implementing Derive on structs containing an array with a length greater than 32 - Derive isn't implemented on the array, so we have to convert the fields to slices before they can be printed, and that has to be done manually.

The custom Clone implementation was there to work around a compiler bug, with some types implementing Copy but not clone. That may be fixed by now, though, so I'll look into removing it.

Osspial avatar Feb 14 '18 17:02 Osspial