rust/src/libstd_unicode
Alex Crichton 742ca0caf2 std: Respect formatting flags for str-like OsStr
Historically many `Display` and `Debug` implementations for `OsStr`-like
abstractions have gone through `String::from_utf8_lossy`, but this was updated
in #42613 to use an internal `Utf8Lossy` abstraction instead. This had the
unfortunate side effect of causing a regression (#43765) in code which relied on
these `fmt` trait implementations respecting the various formatting flags
specified.

This commit opportunistically adds back interpretation of formatting trait flags
in the "common case" where where `OsStr`-like "thing" is all valid utf-8 and can
delegate to the formatting implementation for `str`. This doesn't entirely solve
the regression as non-utf8 paths will format differently than they did before
still (in that they will not respect formatting flags), but this should solve
the regression for all "real world" use cases of paths and such. The door's also
still open for handling these flags in the future!

Closes #43765
2017-08-13 21:07:03 -07:00
..
tests Utf8Lossy type with chunks iterator and impl Display and Debug 2017-06-15 20:42:35 +01:00
Cargo.toml Utf8Lossy type with chunks iterator and impl Display and Debug 2017-06-15 20:42:35 +01:00
char.rs std: Stabilize char_escape_debug 2017-07-25 07:09:31 -07:00
lib.rs std: Respect formatting flags for str-like OsStr 2017-08-13 21:07:03 -07:00
lossy.rs std: Respect formatting flags for str-like OsStr 2017-08-13 21:07:03 -07:00
tables.rs [libstd_unicode] Create UnicodeVersion type 2017-07-21 12:09:02 -06:00
u_str.rs Merge crate collections into alloc 2017-06-13 23:37:34 -07:00
unicode.py [libstd_unicode] Create UnicodeVersion type 2017-07-21 12:09:02 -06:00