-
Notifications
You must be signed in to change notification settings - Fork 968
Removed the last dependencies breaking no-std build. #669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f8ad992
Removed the last dependencies breaking no-std build.
lvella 45b3cb1
Reverting back to OnceCell.
lvella 102fa52
Hex encoding debug print.
lvella e5b6091
Merge branch 'main' into no-std
lvella ebb85b5
Using race::OnceBox instead of critical-section.
lvella 3f17224
Lint error.
lvella File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lazy_staticis unmaintained. Please just useonce_cellwithdefault-features = false.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my first try, doesn't work with
once_cell::unsync::OnceCell, which is notSync, thus it can't be used to initialize a static variable. It seemslazy_staticmanages to do it by using a spin-lock, whatonce_celldoesn't have.Anyway, the other crate I removed,
to-binary, is also unmaintained and is older, so I don't see the issue of usinglazy_static.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the
once_cellFAQ:no_stdstd::cell::OnceCell,once_cell, orlazy_static?I say we enable the
critical-sectionfeature. cc @rakitaThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just found
once_cell::race. I'll use it instead oflazy_static.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OnceCell was stabilised inside rust, I would check if it works
https://doc.rust-lang.org/nightly/core/cell/struct.OnceCell.html#:~:text=Struct%20core%3A%3Acell%3A%3AOnceCell&text=A%20cell%20which%20can%20be,borrow%20checks%20(unlike%20RefCell%20).
to-binary is not relevant at all as it had very simpler usecase,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it seems
once_cell::racedoesn't provide a genericOnceCell, instead it is specialized for some types that can be handled by atomic instructions. I'll change this PR to use critical-section.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just came here to write this. We can use
once_cell::race::OnlyBox, it does not require std and it fits nicely with the codeUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I just pushed a version using
critical-section, had to add a new feature and all. Should I change?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to change it, fewer features to maintain and it would work out of the box ( pun intended :))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done