Open h7x4 opened 1 year ago
I don't know what's the best practice, but it might break existing code not impl-ing Debug?
... it might break existing code not impl-ing Debug?
That's a good call. Do you think it would be better to create a manual implementation? I guess something like derivative also is an option, at the cost of introducing a new dependency.
Could this be a package configuration option instead?
That works for me. I've never heard of debug being a used as a configuration option though. Is the intention to include the extra dependency only for those that need it?
I don't think it is a big deal to derive the debug struct personally.
Let all structs derive debug for ease of debugging.
The only thing that I feel is a little questionable about this is making
UsbInterfaceHandler
andUsbDeviceHandler
into a supertraits ofDebug
. Although not semantically correct, it is meant to forceUsbDevice.device_handler: Option<Arc<Mutex<Box<dyn UsbDeviceHandler + Send>>>>
to be debuggable, soUsbDevice
can be so as well. Would it be better to maintain a manual implementation here?