I have a function which tries to match an syntax::ast::ExprBinary(syntax::ast::BinOp, syntax::ptr::P<ast::Expr>, syntax::ptr::P<syntax::ast::Expr>), but I cannot find the right syntax to match the P so I get the contained expression out of it. I see that I can use Deref to get at the Expr, but this is cumbersome.
Is there a way to get rid of the P within the match (or if let) clause?
There's no way to pattern match through a P: the field is private and we don't have generalised pointer pattern matching (yet).
The only ways to get at the contained data are Deref (for a &), and the methods and_then and map (for by-value).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With