move fn to impl

This commit is contained in:
highflowey 2024-08-23 02:57:38 +03:30
parent 62fd0d00b1
commit 27a98f9671

View file

@ -54,12 +54,13 @@ async fn parse_luaurc(_: &mlua::Lua, path: &PathBuf) -> Result<Option<Luaurc>, m
}
}
/// Searches for .luaurc recursively
/// until an alias for the provided `RequireAlias` is found
pub async fn resolve_require_alias<'lua>(
impl Luaurc {
/// Searches for .luaurc recursively
/// until an alias for the provided `RequireAlias` is found
pub async fn resolve_path<'lua>(
lua: &'lua mlua::Lua,
alias: &'lua RequireAlias,
) -> Result<PathBuf, mlua::Error> {
) -> Result<PathBuf, mlua::Error> {
let cwd = current_dir()?;
let parent = cwd.join(get_parent_path(lua)?);
let ancestors = parent.ancestors();
@ -84,4 +85,5 @@ pub async fn resolve_require_alias<'lua>(
"Coudln't find the alias '{}' in any .luaurc file",
alias.alias
)))
}
}