usbip
usbip copied to clipboard
Derive Debug for all structs
Let all structs derive debug for ease of debugging.
The only thing that I feel is a little questionable about this is making UsbInterfaceHandler
and UsbDeviceHandler
into a supertraits of Debug
. Although not semantically correct, it is meant to force UsbDevice.device_handler: Option<Arc<Mutex<Box<dyn UsbDeviceHandler + Send>>>>
to be debuggable, so UsbDevice
can be so as well. Would it be better to maintain a manual implementation here?
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.
Pull Request Test Coverage Report for Build 5312749491
Warning: This coverage report may be inaccurate.
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
- For more information on this, see Tracking coverage changes with pull request builds.
- To avoid this issue with future PRs, see these Recommended CI Configurations.
- For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
Details
- 3 of 11 (27.27%) changed or added relevant lines in 6 files are covered.
- 6 unchanged lines in 3 files lost coverage.
- Overall coverage decreased (-0.3%) to 41.353%
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
---|---|---|---|
src/cdc.rs | 0 | 1 | 0.0% |
src/interface.rs | 0 | 1 | 0.0% |
src/lib.rs | 0 | 1 | 0.0% |
src/host.rs | 0 | 2 | 0.0% |
src/hid.rs | 0 | 3 | 0.0% |
<!-- | Total: | 3 | 11 |
Files with Coverage Reduction | New Missed Lines | % |
---|---|---|
src/hid.rs | 2 | 25.0% |
src/host.rs | 2 | 0.0% |
src/lib.rs | 2 | 52.71% |
<!-- | Total: | 6 |
Totals | |
---|---|
Change from base Build 4244317147: | -0.3% |
Covered Lines: | 550 |
Relevant Lines: | 1330 |
💛 - Coveralls
Pull Request Test Coverage Report for Build 5312749491
Warning: This coverage report may be inaccurate.
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
- For more information on this, see Tracking coverage changes with pull request builds.
- To avoid this issue with future PRs, see these Recommended CI Configurations.
- For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
Details
- 3 of 11 (27.27%) changed or added relevant lines in 6 files are covered.
- 6 unchanged lines in 3 files lost coverage.
- Overall coverage decreased (-0.3%) to 41.353%
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
---|---|---|---|
src/cdc.rs | 0 | 1 | 0.0% |
src/interface.rs | 0 | 1 | 0.0% |
src/lib.rs | 0 | 1 | 0.0% |
src/host.rs | 0 | 2 | 0.0% |
src/hid.rs | 0 | 3 | 0.0% |
<!-- | Total: | 3 | 11 |
Files with Coverage Reduction | New Missed Lines | % |
---|---|---|
src/hid.rs | 2 | 25.0% |
src/host.rs | 2 | 0.0% |
src/lib.rs | 2 | 52.71% |
<!-- | Total: | 6 |
Totals | |
---|---|
Change from base Build 4244317147: | -0.3% |
Covered Lines: | 550 |
Relevant Lines: | 1330 |