From d9f4afceb9018eeda4a9d2033716702d0c819302 Mon Sep 17 00:00:00 2001 From: Lorenz Hruby Date: Mon, 30 Sep 2024 07:33:26 +0000 Subject: [PATCH] Fix warnings --- .../serdes/include/hephaestus/serdes/protobuf/enums.h | 9 +++++---- modules/types_proto/src/dummy_type.cpp | 3 --- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/serdes/include/hephaestus/serdes/protobuf/enums.h b/modules/serdes/include/hephaestus/serdes/protobuf/enums.h index dc61a623..15dcafee 100644 --- a/modules/serdes/include/hephaestus/serdes/protobuf/enums.h +++ b/modules/serdes/include/hephaestus/serdes/protobuf/enums.h @@ -61,10 +61,11 @@ template fmt::format("{}_{}", proto_prefix, magic_enum::enum_name(e)); // ClassName_EnumName_ENUM_VALUE auto proto_enum = magic_enum::enum_cast(proto_enum_name); - heph::throwExceptionIf( - !proto_enum.has_value(), - fmt::format("The proto enum does not contain the requested key {}. Proto enum keys are\n{}", - proto_enum_name, utils::format::toString(magic_enum::enum_names()))); + if (!proto_enum.has_value()) { + heph::throwException( + fmt::format("The proto enum does not contain the requested key {}. Proto enum keys are\n{}", + proto_enum_name, utils::format::toString(magic_enum::enum_names()))); + } return proto_enum.value(); } diff --git a/modules/types_proto/src/dummy_type.cpp b/modules/types_proto/src/dummy_type.cpp index d9918eb1..3aadcbbd 100644 --- a/modules/types_proto/src/dummy_type.cpp +++ b/modules/types_proto/src/dummy_type.cpp @@ -7,9 +7,6 @@ #include #include -#include -#include - #include "hephaestus/serdes/protobuf/enums.h" #include "hephaestus/types/dummy_type.h" #include "hephaestus/types/proto/dummy_type.pb.h"