From 52304683d73bce358bb05d24d58005e188a881f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Nordl=C3=B6w?= Date: Sat, 25 Sep 2021 01:47:13 +0200 Subject: [PATCH] Improve searchPathFor --- std/process.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/std/process.d b/std/process.d index 7ec8fa1dc..0f4d50663 100644 --- a/std/process.d +++ b/std/process.d @@ -1498,10 +1498,10 @@ package(std) string searchPathFor(scope const(char)[] executable) @safe { import std.algorithm.iteration : splitter; - import std.conv : text; + import std.conv : to; import std.path : chainPath; - string result; + typeof(return) result; environment.getImpl("PATH", (scope const(char)[] path) @@ -1514,7 +1514,7 @@ package(std) string searchPathFor(scope const(char)[] executable) auto execPath = chainPath(dir, executable); if (isExecutable(execPath)) { - result = text(execPath); + result = execPath.to!(typeof(result)); return; } }