-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove the last unsafe block #1852
Conversation
I'll give it a proper review tomorrow. Past-midnight reviews may be fun but they aren't particularly correct ;)
Yes, please.
If I get it right, the only platform > 1.40 (current clap MSRV) is the one rust doesn't support yet, not officially. If that's so, we can proceed as is.
Nah. The most common usage for I wonder what you mean by "adds less REPLACEMENT_CHARACTERs"? I always thought that the replacement symbol is used like: "every byte from input that is not a part of a valid codepoint will be replaced with �", so every implementation must insert the same number of them given the same input is provided. Am I wrong? |
Agreed ;)
I think you're right that HermitCore isn't officially supported yet. Either way, the limitation is only due to the availability of
I'm not sure if this is suggesting that I should convert it to
There's a difference in when Take
|
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.
Looks good to me. But I will wait for @CreepySkeleton to review it. I have one question though, it looks like the ArgStr
is a pretty common abstraction that can be used in multiple other packages. Could we extract it out?
Never mind. For some reason I thought it always copies the contents, but I would be OK with that too. Probably has something to do with post-midnight.
Well, if it looks like implementations are allowed to behave frivolous here and, since I doubt someone out there is going to rely on precise number of �, we can do as we please. Let's follow the path of least resistance and leave it as is. |
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.
This is marvelous! Very clean and fleshed out. Your crate is amazing.
Not much point. It's just a tiny wrapper around @dylni could you please rebase onto mater? |
I'm considering creating a wrapper crate. I've typically used bstr to reduce repetition, but I can see that a few edge cases aren't intuitive to handle correctly. This would take time, which I don't have much of currently, but I can let you know if I publish something that makes this easier. |
Agreed.
Thanks! This is always great feedback to receive.
Done. |
@dylni Please do keep me updated about it. bors r+ |
Build succeeded: |
Closes #1594
This was relatively clean. All uses were compatible except one. Another is now improved to not truncate. But, most changes only replace
OsStr
withArgStr
to avoid repeated conversions.Notes:
OsStr
has its own implementation that was used previously and adds lessREPLACEMENT_CHARACTER
s. To give the same result now would require converting toOsStr
before the lossy conversion, which would be slower.osstringext.rs
be renamed toargstr.rs
?