From f96b001064c2dcdd8038f0aa03c372aaa2f2a132 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 26 Oct 2023 14:01:51 -0700 Subject: Don't call android.PathForModuleSrc(ctx).String() to get ModuleDir ctx.ModuleDir is much cheaper than android.PathForModuleSrc(ctx).String(). Test: builds Change-Id: I81819088d9564b06a0336a59a45f2b110b0bd9d6 --- rust/builder.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rust/builder.go') diff --git a/rust/builder.go b/rust/builder.go index 72e5be18b..162d1aab0 100644 --- a/rust/builder.go +++ b/rust/builder.go @@ -288,7 +288,7 @@ func transformSrctoCrate(ctx ModuleContext, main android.Path, deps PathDeps, fl } // Disallow experimental features - modulePath := android.PathForModuleSrc(ctx).String() + modulePath := ctx.ModuleDir() if !(android.IsThirdPartyPath(modulePath) || strings.HasPrefix(modulePath, "prebuilts")) { rustcFlags = append(rustcFlags, "-Zallow-features=\"\"") } @@ -436,7 +436,7 @@ func Rustdoc(ctx ModuleContext, main android.Path, deps PathDeps, docTimestampFile := android.PathForModuleOut(ctx, "rustdoc.timestamp") // Silence warnings about renamed lints for third-party crates - modulePath := android.PathForModuleSrc(ctx).String() + modulePath := ctx.ModuleDir() if android.IsThirdPartyPath(modulePath) { rustdocFlags = append(rustdocFlags, " -A warnings") } -- cgit v1.2.3-59-g8ed1b