diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-03-24 21:32:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-24 21:32:36 +0100 |
| commit | db2c70bf4e9efcb53adcb8ed9c5b7eae8a55f33d (patch) | |
| tree | efe756070f1f4e129f4f8b74d1dd5728376fd516 /src/liballoc/string.rs | |
| parent | dc2901629960136330e86c02a0889f41481b4b00 (diff) | |
| parent | 42b10e51c18ad37f671dc289aa0f183d4dbceab9 (diff) | |
| download | rust-db2c70bf4e9efcb53adcb8ed9c5b7eae8a55f33d.tar.gz rust-db2c70bf4e9efcb53adcb8ed9c5b7eae8a55f33d.zip | |
Rollup merge of #70359 - kornelski:mustsplit, r=Dylan-DPC
must_use on split_off A couple more for #70194
Diffstat (limited to 'src/liballoc/string.rs')
| -rw-r--r-- | src/liballoc/string.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index 0e48f1548e6..7c89d38caa4 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -1461,6 +1461,7 @@ impl String { /// ``` #[inline] #[stable(feature = "string_split_off", since = "1.16.0")] + #[must_use = "use `.truncate()` if you don't need the other half"] pub fn split_off(&mut self, at: usize) -> String { assert!(self.is_char_boundary(at)); let other = self.vec.split_off(at); |
