-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
[std] Osstr lossy example #56142
[std] Osstr lossy example #56142
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Thanks for the PR! Can this be implemented as an example without making it memory unsafe though? As-is this is susceptible to future breakage because the example itself is exhibiting memory unsafety. |
The only options are (as far as I can see) otherwise the OsStr methods in std would need to be extended to provide a cleaner solution fyi, this and a couple of other similar push requests were a precursor to a further push request to extend OsStr handling in std to allow splitting, as needed by an upcoming v2.0 of my cmd-line arg parsing library (which is currently having to transmute). I started investigating how best to implement that, but never got around to finishing. The best solution for that would likely be to just open up from/to byte array methods, perhaps with method names like |
Yes to implement this the best way would be via the OS extension traits such as |
Triage; @jnqnfe Hello, have you been able to get back to this PR? |
d89c4d0
to
0008e0d
Compare
@Aaronepower @alexcrichton Yes, sorry for the delay, I'm largely working offline with no internet from home. I've reworked the change as suggested. I also fixed it so that it will actually work correctly on Windows, having corrected a misunderstanding from not examining closely enough what the Windows/WTF-8 to-lossy code was doing. |
@bors: r+ Looks good to me, thanks! |
📌 Commit 0008e0d has been approved by |
⌛ Testing commit 0008e0d with merge 9d1f8f1c6ed41d9d60ec402a1c345b2838cfe6e6... |
💔 Test failed - status-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
…richton [std] Osstr lossy example
☀️ Test successful - status-appveyor, status-travis |
No description provided.