Skip to content

Why does to_result() in libtock-rs/platform/src/command_return.rs return BADRVAL for a driver check? #441

Answered by hudson-ayers
potto216 asked this question in Q&A
Discussion options

You must be logged in to vote

Agreed that is not expected. The docs for to_result() recommend using type ascription to make the types for to_result() explicit at the call site -- I suspect that the type for T is being inferred incorrectly leading to the return value you see. I recommend trying let res: Result<(), ErrorCode> = S::command(...).to_result();

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@potto216
Comment options

@potto216
Comment options

@hudson-ayers
Comment options

@potto216
Comment options

Answer selected by potto216
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants