From f3ac764684c64fbdd2094853a80b23e570cd5d9c Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Tue, 15 Oct 2024 20:56:26 -0500 Subject: Conver to using static constructors for string, sqlite, files. --- source/libfud.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/libfud.cpp') diff --git a/source/libfud.cpp b/source/libfud.cpp index 8c962ba..cec544d 100644 --- a/source/libfud.cpp +++ b/source/libfud.cpp @@ -50,12 +50,12 @@ Result getEnv(const char* name) return RetType::error(FudStatus::NotFound); } - String envVar{resultString}; - if (!envVar.valid()) { - return RetType::error(FudStatus::Failure); + auto envVarResult = String::makeFromCString(resultString); + if (envVarResult.isError()) { + return RetType::error(envVarResult); } - return RetType::okay(std::move(envVar)); + return RetType::okay(envVarResult); } } // namespace fud -- cgit v1.2.3