Skip to content

mctp-usb: Simply return the header in MctpUsbHandler::header()#46

Open
SafetyInObscurity wants to merge 1 commit intoCodeConstruct:mainfrom
SafetyInObscurity:return-type
Open

mctp-usb: Simply return the header in MctpUsbHandler::header()#46
SafetyInObscurity wants to merge 1 commit intoCodeConstruct:mainfrom
SafetyInObscurity:return-type

Conversation

@SafetyInObscurity
Copy link
Copy Markdown

Current implementation takes destination variable as a mutable argument and modifies it. It would be better for the function to simply return the header, rather than an empty Ok(()) on success.

@jk-ozlabs
Copy link
Copy Markdown
Member

Looks good! The CI failure looks like a general thing from the nightly toolchain, which we may want to address separately.

The change itself looks good, I would suggest a couple of things on the commit message though:

Simply return the header in MctpUsbHandler::header()

I'd suggest a prefix on this, as you have done in the PR. Since we're modifying multiple crates, perhaps usb:?

I'd also suggest some more context in the commit message; for example, why would it be better, and what effects would this have on the public API? (are there users of MctpUsbHandler::header that we need to worry about?)

@mkj
Copy link
Copy Markdown
Member

mkj commented May 4, 2026

Looks good! The CI failure looks like a general thing from the nightly toolchain, which we may want to address separately.

I have a pending change here to remove nightly toolchain from the PR CI job, and run it separately on a timer. I'll push that soon as a separate PR.

Current implementation takes destination variable as a mutable argument and modifies it.
It would be better for the function to simply return the header, rather than an empty `Ok(())` on success.
This breaks the current API for header(), but adjustment should be simple.

Signed-off-by: James Lee <james@codeconstruct.com.au>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants