mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-20 19:45:21 +00:00
Remove unnecessary boxing of ASDL product children
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
parent
6e89b3ab1a
commit
f4672e4256
5 changed files with 15 additions and 17 deletions
|
@ -72,10 +72,7 @@ pub fn parse_args(func_args: Vec<FunctionArgument>) -> Result<ArgumentList, Lexi
|
|||
keywords.push(ast::Keyword::new(
|
||||
start,
|
||||
end,
|
||||
ast::KeywordData {
|
||||
arg: name,
|
||||
value: Box::new(value),
|
||||
},
|
||||
ast::KeywordData { arg: name, value },
|
||||
));
|
||||
}
|
||||
None => {
|
||||
|
|
|
@ -117,7 +117,7 @@ impl TryFrom<ExprOrWithitems> for Vec<ast::Withitem> {
|
|||
.items
|
||||
.into_iter()
|
||||
.map(|(context_expr, optional_vars)| ast::Withitem {
|
||||
context_expr: Box::new(context_expr),
|
||||
context_expr,
|
||||
optional_vars: optional_vars.map(|expr| {
|
||||
Box::new(context::set_context(*expr, ast::ExprContext::Store))
|
||||
}),
|
||||
|
@ -125,7 +125,7 @@ impl TryFrom<ExprOrWithitems> for Vec<ast::Withitem> {
|
|||
.collect())
|
||||
}
|
||||
_ => Ok(vec![ast::Withitem {
|
||||
context_expr: Box::new(expr_or_withitems.try_into()?),
|
||||
context_expr: expr_or_withitems.try_into()?,
|
||||
optional_vars: None,
|
||||
}]),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue