From 6b33651a90a88b22b8575bf9801cf77ab1ef4318 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Tue, 18 Jan 2022 14:25:18 +0200 Subject: [PATCH] Construct a PathBuf Representing what's the data here holistically. --- tests/functions.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/functions.rs b/tests/functions.rs index 10f5af6fb..c8d1952b3 100644 --- a/tests/functions.rs +++ b/tests/functions.rs @@ -7,11 +7,13 @@ use libloading::{Library, Symbol}; const TARGET_DIR: Option<&'static str> = option_env!("CARGO_TARGET_DIR"); const TARGET_TMPDIR: Option<&'static str> = option_env!("CARGO_TARGET_TMPDIR"); -fn lib_path() -> &'static str { - format!( - "{}/libtest_helpers.module", - TARGET_TMPDIR.unwrap_or(TARGET_DIR.unwrap_or("target")) - ) +fn lib_path() -> std::path::PathBuf { + [ + TARGET_TMPDIR.unwrap_or(TARGET_DIR.unwrap_or("target")), + "libtest_helpers.module", + ] + .iter() + .collect() } fn make_helpers() {