Add a module with a read-only std::env-style interface that reads from apple args#2
Draft
thomcc wants to merge 5 commits into
Draft
Add a module with a read-only std::env-style interface that reads from apple args#2thomcc wants to merge 5 commits into
thomcc wants to merge 5 commits into
Conversation
… unleak and it avoids extra (fallible) work
…rom the apple args instead
thomcc
commented
Aug 1, 2022
| //! not writing) functions in [`std::env`], but which use the apple arguments | ||
| //! instead. | ||
| //! | ||
| //! The used for the apple arguments may be unstable, so the functions in this |
| } | ||
|
|
||
| fn args_slice_iter() -> core::slice::Iter<'static, Vec<u8>> { | ||
| fn args_slice() -> &'static [&'static [u8]] { |
Author
There was a problem hiding this comment.
This change didn't end up being needed.
| fn strlen(s: *const c_char) -> usize; | ||
| } | ||
|
|
||
| struct AbortGuard; |
Author
There was a problem hiding this comment.
This is unrelated but a good idea (I didn't think of it when you asked me to look before).
Author
|
I updated this quite a bit, but most of these changes I made a while ago, and it does feel like some of them shouldn't really be part of the same patchset... |
Author
|
I also am pretty sure I intended to add more tests... |
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.
Needs tests and docs I guess. Also has other stuff too -- mostly because I had intended to make most of these functions more testable by allowing them to be passed a
&'static [&'static [u8]]. As a result, it's a slightly larger patch than is needed.Not sure when I'll finish this so feel free to take and do with it what you like (even if that's "discard it").