]> git.lizzy.rs Git - rust.git/blobdiff - src/libserialize/json.rs
Rollup merge of #53313 - llogiq:two-small-improvements, r=estebank
[rust.git] / src / libserialize / json.rs
index 00ccd062e0a3bdedf8cb84b04833901903092dcf..35ef6327de5fd81f73c63b2092cf79fc6da36745 100644 (file)
@@ -1390,10 +1390,9 @@ fn pop(&mut self) {
 
     // Used by Parser to test whether the top-most element is an index.
     fn last_is_index(&self) -> bool {
-        if let Some(InternalIndex(_)) = self.stack.last() {
-            true
-        } else {
-            false
+        match self.stack.last() {
+            Some(InternalIndex(_)) => true,
+            _ => false,
         }
     }