diff options
| author | bors <bors@rust-lang.org> | 2016-04-16 23:06:29 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-04-16 23:06:29 -0700 |
| commit | b5de94fba9a137a1128448f4b703250e7e8ff975 (patch) | |
| tree | 57b28ae22fc683cd89d65477466375e335c09218 /src/liballoc_system | |
| parent | 6892277cc030a9bc9931a644fffd3f420c41a6de (diff) | |
| parent | ae79ce3f030db27aa7d35d1b22307fb4eba14f36 (diff) | |
| download | rust-b5de94fba9a137a1128448f4b703250e7e8ff975.tar.gz rust-b5de94fba9a137a1128448f4b703250e7e8ff975.zip | |
Auto merge of #32977 - alexcrichton:ignore-panics, r=brson
std: Change String::truncate to panic less The `Vec::truncate` method does not panic if the length argument is greater than the vector's current length, but `String::truncate` will indeed panic. This semantic difference can be a bit jarring (e.g. #32717), and after some discussion the libs team concluded that although this can technically be a breaking change it is almost undoubtedly not so in practice. This commit changes the semantics of `String::truncate` to be a noop if `new_len` is greater than the length of the current string. Closes #32717
Diffstat (limited to 'src/liballoc_system')
0 files changed, 0 insertions, 0 deletions
