Add display method to OsStr

Add `display` method to `OsStr` for lossy display of an `OsStr` which may contain invalid unicode.

Invalid Unicode sequences are replaced with `U+FFFD REPLACEMENT CHARACTER`.

This change also makes the `std::ffi::os_str` module public.
This commit is contained in:
riverbl 2024-01-07 13:58:39 +00:00
parent 8424f8e8cd
commit a0fcc8ebc0
4 changed files with 73 additions and 10 deletions

View file

@ -4,6 +4,6 @@
const EXPECTED = {
'query': 'OsString -> String',
'others': [
{ 'path': 'std::ffi::OsString', 'name': 'into_string' },
{ 'path': 'std::ffi::os_str::OsString', 'name': 'into_string' },
]
};