Skip to content

Commit ffa3789

Browse files
Drop box syntax
`box_syntax` has been removed from rust: rust-lang/rust#108471. Use `Box::new` instead.
1 parent 6f51f26 commit ffa3789

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/eval.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ impl SimplExpr {
6161
pub fn map_terminals_into(self, f: impl Fn(Self) -> Self) -> Self {
6262
use SimplExpr::*;
6363
match self {
64-
BinOp(span, box a, op, box b) => BinOp(span, box f(a), op, box f(b)),
65-
UnaryOp(span, op, box a) => UnaryOp(span, op, box f(a)),
66-
IfElse(span, box a, box b, box c) => IfElse(span, box f(a), box f(b), box f(c)),
67-
JsonAccess(span, box a, box b) => JsonAccess(span, box f(a), box f(b)),
64+
BinOp(span, box a, op, box b) => BinOp(span, Box::new(f(a)), op, Box::new(f(b))),
65+
UnaryOp(span, op, box a) => UnaryOp(span, op, Box::new(f(a))),
66+
IfElse(span, box a, box b, box c) => IfElse(span, Box::new(f(a)), Box::new(f(b)), Box::new(f(c))),
67+
JsonAccess(span, box a, box b) => JsonAccess(span, Box::new(f(a)), Box::new(f(b))),
6868
FunctionCall(span, name, args) => FunctionCall(span, name, args.into_iter().map(f).collect()),
6969
other => f(other),
7070
}
@@ -76,13 +76,13 @@ impl SimplExpr {
7676
match self {
7777
// Literal(x) => Ok(Literal(AttrValue::from_primitive(x.resolve_fully(&variables)?))),
7878
Literal(span, x) => Ok(Literal(span, x)),
79-
BinOp(span, box a, op, box b) => Ok(BinOp(span, box a.resolve_refs(variables)?, op, box b.resolve_refs(variables)?)),
80-
UnaryOp(span, op, box x) => Ok(UnaryOp(span, op, box x.resolve_refs(variables)?)),
79+
BinOp(span, box a, op, box b) => Ok(BinOp(span, Box::new(a.resolve_refs(variables)?), op, Box::new(b.resolve_refs(variables)?))),
80+
UnaryOp(span, op, box x) => Ok(UnaryOp(span, op, Box::new(x.resolve_refs(variables)?))),
8181
IfElse(span, box a, box b, box c) => {
82-
Ok(IfElse(span, box a.resolve_refs(variables)?, box b.resolve_refs(variables)?, box c.resolve_refs(variables)?))
82+
Ok(IfElse(span, Box::new(a.resolve_refs(variables)?), Box::new(b.resolve_refs(variables)?), Box::new(c.resolve_refs(variables)?)))
8383
}
8484
JsonAccess(span, box a, box b) => {
85-
Ok(JsonAccess(span, box a.resolve_refs(variables)?, box b.resolve_refs(variables)?))
85+
Ok(JsonAccess(span, Box::new(a.resolve_refs(variables)?), Box::new(b.resolve_refs(variables)?)))
8686
}
8787
FunctionCall(span, function_name, args) => Ok(FunctionCall(
8888
span,

src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(box_patterns)]
2-
#![feature(box_syntax)]
32
#![feature(try_blocks)]
43
pub mod ast;
54
pub mod dynval;

0 commit comments

Comments
 (0)