diff options
| author | bors <bors@rust-lang.org> | 2017-12-10 00:57:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-12-10 00:57:40 +0000 |
| commit | c89e206eedee079c4620eacbfb4e3bc6cf392fc8 (patch) | |
| tree | d362e737537921ce60a13c88139b708e63e29a01 /src/liballoc/string.rs | |
| parent | 8db163e53dab4f188a60bf24b4d6ebeb1ea5cab1 (diff) | |
| parent | 3024c1434a667425d30e4b0785857381323712aa (diff) | |
| download | rust-c89e206eedee079c4620eacbfb4e3bc6cf392fc8.tar.gz rust-c89e206eedee079c4620eacbfb4e3bc6cf392fc8.zip | |
Auto merge of #46602 - mbrubeck:try, r=kennytm
Replace option_try macros and match with ? operator None
Diffstat (limited to 'src/liballoc/string.rs')
| -rw-r--r-- | src/liballoc/string.rs | 5 |
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); |
