fixes and macos stuff

This commit is contained in:
Mars 2025-04-24 13:01:16 -04:00
parent 9695ceec8a
commit 801a8d1754
Signed by: pupbrained
GPG key ID: 874E22DF2F9DFCB5
10 changed files with 108 additions and 115 deletions

View file

@ -39,7 +39,7 @@ namespace {
DEBUG_LOG("Reading from cache file...");
try {
const String content((std::istreambuf_iterator(ifs)), std::istreambuf_iterator<char>());
const String content((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
WeatherOutput result;
if (const glz::error_ctx errc = glz::read<glaze_opts>(result, content); errc.ec != glz::error_code::none)
@ -79,7 +79,9 @@ namespace {
std::error_code errc;
fs::rename(tempPath, *cachePath, errc);
if (errc) {
fs::remove(tempPath, errc);
if (!fs::remove(tempPath, errc))
DEBUG_LOG("Failed to remove temp file: {}", errc.message());
return Err("Failed to replace cache file: " + errc.message());
}