get the var declaration of this var, e.g., const char* name.
(&self)
| 96 | |
| 97 | /// get the var declaration of this var, e.g., const char* name. |
| 98 | pub fn get_var_decl_name(&self) -> String { |
| 99 | let mut ty = self.get_type().get_type_name(); |
| 100 | let name = self.get_name_as_string(); |
| 101 | if let Some(pos) = ty.find('[') { |
| 102 | ty.insert(pos, ' '); |
| 103 | ty.insert_str(pos + 1, &name); |
| 104 | return ty; |
| 105 | } |
| 106 | ty.push(' '); |
| 107 | ty.push_str(&name); |
| 108 | ty |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | #[derive(Deserialize, Debug, Clone)] |
nothing calls this directly
no test coverage detected