From 8249b28bea29e8ce17eac12776a60ec3f9e47176 Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Thu, 17 Oct 2024 19:42:29 -0500 Subject: Rename InvalidInput to ArgumentInvalid. --- source/libfud.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'source/libfud.cpp') diff --git a/source/libfud.cpp b/source/libfud.cpp index 538d3a9..802b2c7 100644 --- a/source/libfud.cpp +++ b/source/libfud.cpp @@ -37,7 +37,7 @@ FUD fud() return fudInfo; } -Result getEnv(const char* name) +Result getEnv(const char* name, Allocator* allocator) { using RetType = Result; @@ -50,12 +50,7 @@ Result getEnv(const char* name) return RetType::error(FudStatus::NotFound); } - auto envVarResult = String::makeFromCString(resultString); - if (envVarResult.isError()) { - return RetType::error(envVarResult); - } - - return RetType::okay(std::move(envVarResult)); + return String::makeFromCString(resultString, allocator); } } // namespace fud -- cgit v1.2.3