Implement no_std support with simplified to_string#33
Closed
AdnoC wants to merge 5 commits intobytesize-rs:masterfrom
Closed
Implement no_std support with simplified to_string#33AdnoC wants to merge 5 commits intobytesize-rs:masterfrom
no_std support with simplified to_string#33AdnoC wants to merge 5 commits intobytesize-rs:masterfrom
Conversation
Member
|
I'm sorry for a late review. I'll review asap by this week. |
Author
|
Rebased off of master because there were merge conflicts. The example showing the use of |
Member
Author
|
I'm just glad I'll be able to move off of my private version. Thanks for merging a |
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.
My attempt at resolving #3.
Some things had to change. Firstly, in order to support alignment format specifiers we would have to write to a buffer and then
Formatter::padthat. So we do not support alignment inno_std. I can add that if that is a requirement, but I felt that implementing the buffer would be a lot.Also, the algorithm used to select the correct units had to change.
no_stddoes not have access to complex math likeln. So we just manually check which unit is correct and go from there.Nothing should be changed when
stdis enabled. These things are conditionally changed when thestdfeature is disabled.If you test with
cargo test --no-default-featuresit will run all the tests that can be run withno_std.Oh! Also I put aside the parsing element. None of that is enabled when not using the standard library.