Build a struct signature string.
(&self, node: &Node, source: &str)
| 427 | |
| 428 | /// Build a struct signature string. |
| 429 | fn build_struct_signature(&self, node: &Node, source: &str) -> Option<String> { |
| 430 | let name_node = node.child_by_field_name("name")?; |
| 431 | let name = self.node_text(&name_node, source); |
| 432 | |
| 433 | // Check for generic type parameters |
| 434 | let generics = node |
| 435 | .child_by_field_name("type_parameters") |
| 436 | .map(|n| self.node_text(&n, source)) |
| 437 | .unwrap_or_default(); |
| 438 | |
| 439 | let prefix = if self.is_pub(node) { |
| 440 | "pub struct" |
| 441 | } else { |
| 442 | "struct" |
| 443 | }; |
| 444 | |
| 445 | Some(format!("{} {}{}", prefix, name, generics)) |
| 446 | } |
| 447 | |
| 448 | /// Build a trait signature string. |
| 449 | fn build_trait_signature(&self, node: &Node, source: &str) -> Option<String> { |
no test coverage detected