about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/path.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-02-18 19:28:51 +0100
committerRalf Jung <post@ralfj.de>2023-02-18 19:28:51 +0100
commit036929d86dc03197668cd9c6673dcbc4e42dfb17 (patch)
tree3f8cc5587335245d0f5143a31d6971e224f0cf4a /compiler/rustc_parse/src/parser/path.rs
parentaed3b3f38c58714a037c2af47f5c276c135c226f (diff)
parent5643706ca2ca59a47966c03104d4b8d931adb2dd (diff)
downloadrust-036929d86dc03197668cd9c6673dcbc4e42dfb17.tar.gz
rust-036929d86dc03197668cd9c6673dcbc4e42dfb17.zip
Merge from rustc
Diffstat (limited to 'compiler/rustc_parse/src/parser/path.rs')
-rw-r--r--compiler/rustc_parse/src/parser/path.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs
index 2e706a00cf7..49959a8981c 100644
--- a/compiler/rustc_parse/src/parser/path.rs
+++ b/compiler/rustc_parse/src/parser/path.rs
@@ -404,7 +404,7 @@ impl<'a> Parser<'a> {
 
         let is_first_invocation = style == PathStyle::Expr;
         // Take a snapshot before attempting to parse - we can restore this later.
-        let snapshot = if is_first_invocation { Some(self.clone()) } else { None };
+        let snapshot = is_first_invocation.then(|| self.clone());
 
         debug!("parse_generic_args_with_leading_angle_bracket_recovery: (snapshotting)");
         match self.parse_angle_args(ty_generics) {