refactor(rust): align workspace with style rules

This commit is contained in:
2026-09-17 09:57:11 -04:00
parent cf9a671fb8
commit b4b77faaa9
15 changed files with 124 additions and 28 deletions

20
src/monorepo/workspace.rs Normal file
View File

@@ -0,0 +1,20 @@
use std::path::PathBuf;
pub fn resolve_workspace_path(path: PathBuf) -> PathBuf {
resolve_workspace_path_impl(
path,
std::env::var_os("BUILD_WORKSPACE_DIRECTORY").map(PathBuf::from),
)
}
fn resolve_workspace_path_impl(path: PathBuf, workspace: Option<PathBuf>) -> PathBuf {
if path.is_absolute() {
return path;
}
if let Some(workspace) = workspace {
return workspace.join(path);
}
path
}