darklua_core/rules/rename_variables/
function_names.rs1use crate::nodes::LocalFunctionStatement;
2use crate::process::NodeProcessor;
3
4#[derive(Debug, Clone, Default)]
5pub struct CollectFunctionNames {
6 names: Vec<String>,
7}
8
9impl From<CollectFunctionNames> for Vec<String> {
10 fn from(collector: CollectFunctionNames) -> Self {
11 collector.names
12 }
13}
14
15impl NodeProcessor for CollectFunctionNames {
16 fn process_local_function_statement(&mut self, function: &mut LocalFunctionStatement) {
17 self.names
18 .push(function.get_identifier().get_name().to_owned());
19 }
20}