std: make OsString::truncate a no-op when len > current_len#152998
std: make OsString::truncate a no-op when len > current_len#152998rust-bors[bot] merged 1 commit intorust-lang:mainfrom
OsString::truncate a no-op when len > current_len#152998Conversation
|
r? @jhpratt rustbot has assigned @jhpratt. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
9be1130 to
3c790ce
Compare
This comment has been minimized.
This comment has been minimized.
3c790ce to
14f592a
Compare
This comment has been minimized.
This comment has been minimized.
14f592a to
768010a
Compare
768010a to
294a7e2
Compare
OsString::truncate a no-op when len >= current_lenOsString::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.
294a7e2 to
3ecd18c
Compare
|
This seems reasonable, but has it been discussed anywhere? |
|
I don't think it was discussed anywhere to my knowledge, maybe in the original implementation PR? Parity seems like a good idea, but should we ask t-libs-api for confirmation? |
|
cc @rust-lang/libs-api; given that it's unstable I'm not sure what procedure is here. |
Yea, I would defer this to lib-api to make the call. |
|
@bors r+ rollup |
This comment has been minimized.
This comment has been minimized.
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`): #133262 See also: #32977 cc: @alexcrichton, @lolbinarycat
|
💔 Test for 57a5ee9 failed: CI. Failed job:
|
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
@bors retry |
…uwer Rollup of 6 pull requests Successful merges: - #152998 (std: make `OsString::truncate` a no-op when `len > current_len`) - #153682 (Tweak E0599 note) - #153795 (Point turbofish inference errors at the uninferred generic arg) - #153994 (move `tests/ui/invalid` tests to new folders) - #154006 (attrs: Ignore ExprKind::Err when converting path attr expr to lit) - #154012 (unstable impl of `From<{i64, u64}> for f128`)
Align
OsString::truncate(and the underlying WTF-8 implementation) withString::truncateby making it a no-op whenlen > self.len().Previously,
OsString::truncatewould panic iflen > self.len(), whileString::truncatetreats such cases as a no-op.Tracking (
os_string_truncate): #133262See also: #32977
cc: @alexcrichton, @lolbinarycat