Use an @
pattern to shorten some code.
This commit is contained in:
parent
0ca92de473
commit
a47ae57a18
1 changed files with 3 additions and 6 deletions
|
@ -325,12 +325,9 @@ impl<'a> Parser<'a> {
|
||||||
replace_ranges,
|
replace_ranges,
|
||||||
});
|
});
|
||||||
|
|
||||||
// If we support tokens at all
|
// If we support tokens and don't already have them, store the newly captured tokens.
|
||||||
if let Some(target_tokens) = ret.tokens_mut() {
|
if let Some(target_tokens @ None) = ret.tokens_mut() {
|
||||||
if target_tokens.is_none() {
|
*target_tokens = Some(tokens.clone());
|
||||||
// Store our newly captured tokens into the AST node.
|
|
||||||
*target_tokens = Some(tokens.clone());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let final_attrs = ret.attrs();
|
let final_attrs = ret.attrs();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue