luaur_analysis/methods/path_builder_index.rs
1use crate::records::index::Index;
2use crate::records::path_builder::PathBuilder;
3use crate::type_aliases::component::Component;
4
5pub trait PathBuilderIndex {
6 fn index(&mut self, i: usize) -> &mut Self;
7}
8
9impl PathBuilderIndex for PathBuilder {
10 fn index(&mut self, i: usize) -> &mut Self {
11 self.components.push(Component::Index(Index {
12 index: i,
13 variant: crate::enums::variant::Variant::Pack,
14 }));
15 self
16 }
17}