luaur_analysis/methods/path_pop.rs
1use crate::records::path::Path;
2use crate::type_aliases::component::Component;
3use alloc::vec::Vec;
4
5impl Path {
6 pub fn path_pop(&self) -> Path {
7 if self.components.is_empty() {
8 return Path::path();
9 }
10
11 let mut popped: Vec<Component> = self.components.clone();
12 popped.pop();
13 Path::path_vector_component(popped)
14 }
15}