(node: Node<'_>, source: &str)
| 191 | } |
| 192 | |
| 193 | fn owner(node: Node<'_>, source: &str) -> Option<String> { |
| 194 | match node.kind() { |
| 195 | "impl_item" => node |
| 196 | .child_by_field_name("type") |
| 197 | .map(|node| nominal(text(node, source))), |
| 198 | "class_declaration" |
| 199 | | "class_definition" |
| 200 | | "class_specifier" |
| 201 | | "struct_specifier" |
| 202 | | "trait_item" |
| 203 | | "interface_declaration" => node |
| 204 | .child_by_field_name("name") |
| 205 | .map(|node| text(node, source).into()), |
| 206 | _ => None, |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | fn nominal(value: &str) -> String { |
| 211 | value |