From bac526ce721073ab029f3c389819b9c5bb714960 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Thu, 2 May 2024 19:13:54 +0300 Subject: [PATCH] Fix nits --- include/input_mappings.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/input_mappings.hpp b/include/input_mappings.hpp index 4448d6a3..12a3860b 100644 --- a/include/input_mappings.hpp +++ b/include/input_mappings.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include #include @@ -45,7 +46,7 @@ struct InputMappings { data["Mappings"] = toml::table{}; for (const auto& [scancode, key] : container) { - if (data["Mappings"].contains(HID::Keys::keyToName(key)) == false) { + if (!data["Mappings"].contains(HID::Keys::keyToName(key))) { data["Mappings"][HID::Keys::keyToName(key)] = toml::array{}; } @@ -58,8 +59,8 @@ struct InputMappings { static std::optional deserialize(const std::filesystem::path& path, const std::string& wantFrontend) { toml::basic_value data; - std::error_code error; + if (!std::filesystem::exists(path, error)) { if (error) { Helpers::warn("Filesystem error accessing %s (error: %s)\n", path.string().c_str(), error.message().c_str());