mbe: Remove unneeded unwrap

This commit is contained in:
Jonas Platte 2022-09-14 23:49:08 +02:00
parent d6f0fd04ee
commit c4a87ee0ce
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -377,10 +377,10 @@ macro_rules! try_push {
let op = match item.dot.peek() { let op = match item.dot.peek() {
None => { None => {
// We are at or past the end of the matcher of `item`. // 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() { if item.sep_parsed.is_none() {
// Get the `up` matcher // 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); new_pos.bindings = bindings_builder.copy(&new_pos.bindings);
// Add matches from this repetition to the `matches` of `up` // Add matches from this repetition to the `matches` of `up`
bindings_builder.push_nested(&mut new_pos.bindings, &item.bindings); bindings_builder.push_nested(&mut new_pos.bindings, &item.bindings);