diff options
| author | Jonas Platte <jplatte+git@posteo.de> | 2022-09-14 23:49:08 +0200 |
|---|---|---|
| committer | Jonas Platte <jplatte+git@posteo.de> | 2022-09-14 23:49:08 +0200 |
| commit | c4a87ee0cefb57640a9d5219d221e8578a1e6733 (patch) | |
| tree | e98232fee1709694858d662240550f81c0fdd95e | |
| parent | d6f0fd04ee2b6afcb93912f7531fbf2957f93909 (diff) | |
| download | rust-c4a87ee0cefb57640a9d5219d221e8578a1e6733.tar.gz rust-c4a87ee0cefb57640a9d5219d221e8578a1e6733.zip | |
mbe: Remove unneeded unwrap
| -rw-r--r-- | crates/mbe/src/expander/matcher.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/mbe/src/expander/matcher.rs b/crates/mbe/src/expander/matcher.rs index 73082802808..139a8cb8cbe 100644 --- a/crates/mbe/src/expander/matcher.rs +++ b/crates/mbe/src/expander/matcher.rs @@ -377,10 +377,10 @@ fn match_loop_inner<'t>( let op = match item.dot.peek() { None => { // We are at or past the end of the matcher of `item`. - if item.up.is_some() { + if let Some(up) = &item.up { if item.sep_parsed.is_none() { // Get the `up` matcher - let mut new_pos = *item.up.clone().unwrap(); + let mut new_pos = (**up).clone(); new_pos.bindings = bindings_builder.copy(&new_pos.bindings); // Add matches from this repetition to the `matches` of `up` bindings_builder.push_nested(&mut new_pos.bindings, &item.bindings); |
