Skip to content

Commit 0cb0c89

Browse files
committed
run-make-support: extract rust_lib_name helper
1 parent 66e9b7d commit 0cb0c89

File tree

1 file changed

+9
-3
lines changed
  • src/tools/run-make-support/src

1 file changed

+9
-3
lines changed

src/tools/run-make-support/src/lib.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,17 @@ pub fn dynamic_lib_name(name: &str) -> String {
145145
}
146146
}
147147

148-
/// Construct a path to a rust library (rlib) under `$TMPDIR` given the library name. This will return a
149-
/// path with `$TMPDIR` joined with the library name.
148+
/// Construct the rust library name.
149+
#[must_use]
150+
pub fn rust_lib_name(name: &str) -> String {
151+
format!("lib{name}.rlib")
152+
}
153+
154+
/// Construct a path to a rust library (rlib) under `$TMPDIR` given the library name. This will
155+
/// return a path with `$TMPDIR` joined with the library name.
150156
#[must_use]
151157
pub fn rust_lib(name: &str) -> PathBuf {
152-
tmp_dir().join(format!("lib{name}.rlib"))
158+
tmp_dir().join(rust_lib_name(name))
153159
}
154160

155161
/// Construct the binary name based on platform.

0 commit comments

Comments
 (0)