rust/library/alloc
bors 4919988fe1 Auto merge of #91241 - dtolnay:firstchunk, r=oli-obk
Eliminate an unreachable codepath from String::from_utf8_lossy

`Utf8Lossy`'s `Iterator` implementation ensures that only the **final** chunk has an empty slice for `broken`:

dd549dcab4/library/core/src/str/lossy.rs (L46-L47)

Thus the only way the **first** chunk could have an empty `broken` is if it is the **final** chunk, i.e. there is only one chunk total. And the only way that there could be one chunk total with an empty `broken` is if the whole input is valid utf8 and non-empty.

That condition has already been handled by an early return, so at the point that the first `REPLACEMENT` is being pushed, it's impossible for `first_broken` to be empty.
2021-11-27 22:53:21 +00:00
..
benches Add #[must_use] to remaining alloc functions 2021-10-15 11:46:49 -04:00
src Auto merge of #91241 - dtolnay:firstchunk, r=oli-obk 2021-11-27 22:53:21 +00:00
tests Fix Iterator::advance_by contract inconsistency 2021-11-19 13:00:23 +01:00
Cargo.toml