Skip to content

Commit

Permalink
must_use on split_off
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Mar 20, 2020
1 parent f4c675c commit 2f7d7c0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 2f7d7c0

Please sign in to comment.