about summary refs log tree commit diff
path: root/src/liballoc/string.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/liballoc/string.rs')
-rw-r--r--src/liballoc/string.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs
index cd0f4a22e9c..ca493ab27e3 100644
--- a/src/liballoc/string.rs
+++ b/src/liballoc/string.rs
@@ -1044,10 +1044,7 @@ impl String {
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn pop(&mut self) -> Option<char> {
-        let ch = match self.chars().rev().next() {
-            Some(ch) => ch,
-            None => return None,
-        };
+        let ch = self.chars().rev().next()?;
         let newlen = self.len() - ch.len_utf8();
         unsafe {
             self.vec.set_len(newlen);