Skip to content

Commit 2f7d7c0

Browse files
committed
must_use on split_off
1 parent f4c675c commit 2f7d7c0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/liballoc/vec.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,6 +1377,7 @@ impl<T> Vec<T> {
13771377
/// assert_eq!(vec2, [2, 3]);
13781378
/// ```
13791379
#[inline]
1380+
#[must_use = "use `.truncate()` if you don't need the other half"]
13801381
#[stable(feature = "split_off", since = "1.4.0")]
13811382
pub fn split_off(&mut self, at: usize) -> Self {
13821383
assert!(at <= self.len(), "`at` out of bounds");

0 commit comments

Comments
 (0)