IO implementation for embedded-io, rebased and updated#126
Open
tshakah wants to merge 7 commits intorust-embedded:mainfrom
Open
IO implementation for embedded-io, rebased and updated#126tshakah wants to merge 7 commits intorust-embedded:mainfrom
tshakah wants to merge 7 commits intorust-embedded:mainfrom
Conversation
This applies _most_ of the final comments from the review on rust-embedded#101. I phrased one of the changes slightly differently.
Contributor
|
looks good to me! just need to bump the rust version we're testing from |
Author
|
I've updated CI to run 1.81 |
asasine
reviewed
Feb 28, 2026
asasine
left a comment
There was a problem hiding this comment.
Couple of changes for correctness but not gonna block do just comments
Comment on lines
+240
to
+246
| let len = transaction.response.len(); | ||
| buffer[..len].copy_from_slice(&transaction.response[..len]); | ||
|
|
||
| match transaction.expected_err { | ||
| Some(err) => Err(err), | ||
| None => Ok(len), | ||
| } |
There was a problem hiding this comment.
This doesn't match up with the comment on with_error. The expectation response buffer is copied into the buffer argument, even if there's an error.
|
|
||
| #[tokio::test] | ||
| #[cfg(feature = "embedded-hal-async")] | ||
| async fn test_async_spi_mock_write() { |
There was a problem hiding this comment.
spi looks out of place in this test name.
Comment on lines
+675
to
+676
| let err = io.read(&mut [10, 12]).unwrap_err(); | ||
| assert_eq!(err, ErrorKind::ConnectionReset); |
There was a problem hiding this comment.
There should be an assert added here that the mutable slice argument remains unmodified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is just a rebase of #101 with most of the review comments applied, as I went to use
embedded-hal-mockfor a test today and found I needed those features.The only difference from the review is I phrased the optional feature sentence a little differently:
Async is supported with the optionalembedded-hal-asyncfeature.