Skip to content

Commit f5166c4

Browse files
committed
refactor(layout): Consolidate pkg_dir formats
1 parent 5e7b660 commit f5166c4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/cargo/core/compiler/build_runner/compilation_files.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,11 @@ impl<'a, 'gctx: 'a> CompilationFiles<'a, 'gctx> {
245245
};
246246
let name = unit.pkg.package_id().name();
247247
let meta = self.metas[unit];
248-
if let Some(c_extra_filename) = meta.c_extra_filename() {
249-
format!("{}{}{}", name, separator, c_extra_filename)
250-
} else {
251-
format!("{}{}{}", name, separator, self.target_short_hash(unit))
252-
}
248+
let hash = meta
249+
.c_extra_filename
250+
.map(|h| h.to_string())
251+
.unwrap_or_else(|| self.target_short_hash(unit));
252+
format!("{name}{separator}{hash}")
253253
}
254254

255255
/// Returns the final artifact path for the host (`/…/target/debug`)

0 commit comments

Comments
 (0)