From 42b10e51c18ad37f671dc289aa0f183d4dbceab9 Mon Sep 17 00:00:00 2001 From: Kornel Date: Tue, 24 Mar 2020 13:33:35 +0000 Subject: must_use on split_off #70194 --- src/liballoc/string.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/liballoc/string.rs') 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); -- cgit 1.4.1-3-g733a5