Skip to main content

luaur_cli_lib/methods/
vfs_navigator_to_child.rs

1use crate::enums::navigation_status::NavigationStatus;
2use crate::functions::normalize_path::normalize_path;
3use crate::records::vfs_navigator::VfsNavigator;
4
5impl VfsNavigator {
6    pub fn to_child(&mut self, name: &str) -> NavigationStatus {
7        if name == ".config" {
8            return NavigationStatus::NotFound;
9        }
10
11        self.module_path = normalize_path(&format!("{}/{}", self.module_path, name));
12        self.absolute_module_path =
13            normalize_path(&format!("{}/{}", self.absolute_module_path, name));
14
15        self.update_real_paths()
16    }
17}