From 5c9f7fcbb0a667f7391b94beb65f1a670ad13221 Mon Sep 17 00:00:00 2001 From: Ethan Menell Date: Sat, 18 May 2024 17:41:30 -0500 Subject: [PATCH] Fix compilation on MacOS (#498) * Fix macos compilation * Trying as_deref for a quick solution * Guess I do have to reference a local variable. Unknown if this will cause issues with the pointer down the line. Since there's no ctx lifetime on the section, this should be fine. --- src/values/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/values/mod.rs b/src/values/mod.rs index d40334fe02c..408ecca74f6 100644 --- a/src/values/mod.rs +++ b/src/values/mod.rs @@ -217,13 +217,15 @@ impl<'ctx> Value<'ctx> { /// Sets the section of the global value fn set_section(self, section: Option<&str>) { #[cfg(target_os = "macos")] - let section = section.map(|s| { + let mapped_section = section.map(|s| { if s.contains(",") { format!("{}", s) } else { format!(",{}", s) } }); + #[cfg(target_os = "macos")] + let section = mapped_section.as_deref(); let c_string = section.map(to_c_str);