mirror of
https://github.com/lune-org/lune.git
synced 2025-04-19 03:13:54 +01:00
move fn to impl
This commit is contained in:
parent
62fd0d00b1
commit
27a98f9671
1 changed files with 25 additions and 23 deletions
|
@ -54,12 +54,13 @@ async fn parse_luaurc(_: &mlua::Lua, path: &PathBuf) -> Result<Option<Luaurc>, m
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Searches for .luaurc recursively
|
impl Luaurc {
|
||||||
/// until an alias for the provided `RequireAlias` is found
|
/// Searches for .luaurc recursively
|
||||||
pub async fn resolve_require_alias<'lua>(
|
/// until an alias for the provided `RequireAlias` is found
|
||||||
|
pub async fn resolve_path<'lua>(
|
||||||
lua: &'lua mlua::Lua,
|
lua: &'lua mlua::Lua,
|
||||||
alias: &'lua RequireAlias,
|
alias: &'lua RequireAlias,
|
||||||
) -> Result<PathBuf, mlua::Error> {
|
) -> Result<PathBuf, mlua::Error> {
|
||||||
let cwd = current_dir()?;
|
let cwd = current_dir()?;
|
||||||
let parent = cwd.join(get_parent_path(lua)?);
|
let parent = cwd.join(get_parent_path(lua)?);
|
||||||
let ancestors = parent.ancestors();
|
let ancestors = parent.ancestors();
|
||||||
|
@ -84,4 +85,5 @@ pub async fn resolve_require_alias<'lua>(
|
||||||
"Coudln't find the alias '{}' in any .luaurc file",
|
"Coudln't find the alias '{}' in any .luaurc file",
|
||||||
alias.alias
|
alias.alias
|
||||||
)))
|
)))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue