(&self, node_id: NodeId)
| 1637 | /// Given a [`Stmt`], return its parent, if any. |
| 1638 | #[inline] |
| 1639 | pub fn parent_statement(&self, node_id: NodeId) -> Option<&'a Stmt> { |
| 1640 | self.nodes |
| 1641 | .ancestor_ids(node_id) |
| 1642 | .filter_map(|id| self.nodes[id].as_statement()) |
| 1643 | .nth(1) |
| 1644 | } |
| 1645 | |
| 1646 | /// Given a [`NodeId`], return the [`NodeId`] of the parent statement, if any. |
| 1647 | pub fn parent_statement_id(&self, node_id: NodeId) -> Option<NodeId> { |
no test coverage detected