(node: Node, source: &str)
| 268 | |
| 269 | #[cfg(feature = "tree-sitter-ast")] |
| 270 | fn extract_name(node: Node, source: &str) -> String { |
| 271 | if let Some(name_node) = node.child_by_field_name("name") { |
| 272 | return node_text(name_node, source); |
| 273 | } |
| 274 | if node.kind() == "impl_item" { |
| 275 | if let Some(target) = node.child_by_field_name("type") { |
| 276 | return node_text(target, source); |
| 277 | } |
| 278 | } |
| 279 | String::new() |
| 280 | } |
| 281 | |
| 282 | #[cfg(feature = "tree-sitter-ast")] |
| 283 | fn decorated_target(node: Node) -> Option<Node> { |
no test coverage detected