Skip to content

Commit 2887f07

Browse files
authored
Trivial tweaks to 'target_short_hash' (#15461)
### What does this PR try to resolve? The `target_short_hash` function is a fallback used by the `pkg_dir` function for units that should not generate `-C extra-filename`. This makes the function private since it would be easy to misuse and fixes an outdated method name in the doc comment. ### How should we test and review this PR? Trivial.
2 parents ab15d58 + 8f06c32 commit 2887f07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ impl<'a, 'gctx: 'a> CompilationFiles<'a, 'gctx> {
199199
}
200200

201201
/// Gets the short hash based only on the `PackageId`.
202-
/// Used for the metadata when `metadata` returns `None`.
203-
pub fn target_short_hash(&self, unit: &Unit) -> String {
202+
/// Used for the metadata when `c_extra_filename` returns `None`.
203+
fn target_short_hash(&self, unit: &Unit) -> String {
204204
let hashable = unit.pkg.package_id().stable_hash(self.ws.root());
205205
util::short_hash(&(METADATA_VERSION, hashable))
206206
}

0 commit comments

Comments
 (0)