diff options
Diffstat (limited to 'src/error.cpp')
| -rw-r--r-- | src/error.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/error.cpp b/src/error.cpp index 3fd18ea..afc33f3 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -9,7 +9,7 @@ #include <windows.h> #include <cstdint> -#include <sstream> +#include <format> #include <string> #include <string_view> #include <system_error> @@ -27,9 +27,7 @@ std::wstring trim_trailing_newline(std::wstring_view s) { } std::string build_what(DWORD code, std::string_view function) { - std::ostringstream what; - what << "Function " << function << " failed with error code " << code; - return what.str(); + return std::format("Function {} failed with error code {}", function, code); } std::string format_message(int32_t code) { |
