Skip to main content

luaur_ast/methods/
ast_stat_declare_function_get_attribute.rs

1use crate::functions::find_attribute_in_array::find_attribute_in_array;
2use crate::records::ast_attr::{AstAttr, AstAttrType};
3use crate::records::ast_stat_declare_function::AstStatDeclareFunction;
4
5impl AstStatDeclareFunction {
6    pub fn get_attribute(&self, attribute_type: AstAttrType) -> *mut AstAttr {
7        find_attribute_in_array(self.attributes, attribute_type)
8    }
9}
10
11#[allow(non_snake_case)]
12pub fn ast_stat_declare_function_get_attribute(
13    this: &AstStatDeclareFunction,
14    attribute_type: AstAttrType,
15) -> *mut AstAttr {
16    this.get_attribute(attribute_type)
17}