Embed minimal required no_std_io2 traits#411
Open
hanabi1224 wants to merge 3 commits intomultiformats:masterfrom
Open
Embed minimal required no_std_io2 traits#411hanabi1224 wants to merge 3 commits intomultiformats:masterfrom
no_std_io2 traits#411hanabi1224 wants to merge 3 commits intomultiformats:masterfrom
Conversation
7997b91 to
d2b2fc8
Compare
Member
|
As it's not as urgent as getting a quick fix out, other things came in between. I'll review it next week. |
As the no-std `Error` is a trimmed down version specifically for this library, it can be simplified. Also add some doc comments back in.
vmx
reviewed
Apr 24, 2026
Member
vmx
left a comment
There was a problem hiding this comment.
I've pushed a new commit, as it was easier to do it that way than leaving a comment. A review from you on my changes would be great.
Though I've one comment left, where I don't understand why you made it std only.
| ($name:ident) => { | ||
| impl<const S: usize> no_std_io2::io::Write for $name<S> { | ||
| fn write(&mut self, buf: &[u8]) -> no_std_io2::io::Result<usize> { | ||
| #[cfg(feature = "std")] |
Member
There was a problem hiding this comment.
Wouldn't it make sense to just add something like this at the top:
#[cfg(feature = "std")]
use std::io;
#[cfg(not(feature = "std"))]
use crate::no_std_io as io;
Contributor
Author
There was a problem hiding this comment.
Fixed.
(Did not implement the custom Write trait to not allow downstream crates to depend on it. But that might not be an issue.)
(Top-level use may not work when the macro is used in another file, using the full trait name instead)
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 PR embedded minimal
no_std_io2traits that are required bymultihash. It should require a minor version bump