diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-03-21 05:33:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-21 05:33:36 +0100 |
| commit | 54285db640453d2beec91423cb8cc792f52797f2 (patch) | |
| tree | f8a09a299d9c7e09f562913e7aadefd3c4f12f0e /src/liballoc | |
| parent | 937ca434b1478f185a8b1335e395a7ce30ab7ee2 (diff) | |
| parent | 2f7d7c03334924d8d7b3630545cef62038ff0526 (diff) | |
| download | rust-54285db640453d2beec91423cb8cc792f52797f2.tar.gz rust-54285db640453d2beec91423cb8cc792f52797f2.zip | |
Rollup merge of #70194 - kornelski:must_split, r=joshtriplett
#[must_use] on split_off() I've noticed this function used for truncation in the wild. `must_use` will clear that up.
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/vec.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index d1956270f13..4769091183a 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -1377,6 +1377,7 @@ impl<T> Vec<T> { /// assert_eq!(vec2, [2, 3]); /// ``` #[inline] + #[must_use = "use `.truncate()` if you don't need the other half"] #[stable(feature = "split_off", since = "1.4.0")] pub fn split_off(&mut self, at: usize) -> Self { assert!(at <= self.len(), "`at` out of bounds"); |
