mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
b1050a74cc
std: make `OsString::truncate` a no-op when `len > current_len` Align `OsString::truncate` (and the underlying WTF-8 implementation) with `String::truncate` by making it a no-op when `len > self.len()`. Previously, `OsString::truncate` would panic if `len > self.len()`, while `String::truncate` treats such cases as a no-op. Tracking (`os_string_truncate`): https://github.com/rust-lang/rust/issues/133262 See also: https://github.com/rust-lang/rust/pull/32977 cc: @alexcrichton, @lolbinarycat