Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lhruby committed Sep 30, 2024
1 parent 602216b commit d9f4afc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 5 additions & 4 deletions modules/serdes/include/hephaestus/serdes/protobuf/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ template <EnumType ProtoT, EnumType T>
fmt::format("{}_{}", proto_prefix, magic_enum::enum_name(e)); // ClassName_EnumName_ENUM_VALUE

auto proto_enum = magic_enum::enum_cast<ProtoT>(proto_enum_name);
heph::throwExceptionIf<heph::InvalidParameterException>(
!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<ProtoT>())));
if (!proto_enum.has_value()) {
heph::throwException<heph::InvalidParameterException>(
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<ProtoT>())));
}

return proto_enum.value();
}
Expand Down
3 changes: 0 additions & 3 deletions modules/types_proto/src/dummy_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
#include <cstddef>
#include <vector>

#include <fmt/core.h>
#include <magic_enum.hpp>

#include "hephaestus/serdes/protobuf/enums.h"
#include "hephaestus/types/dummy_type.h"
#include "hephaestus/types/proto/dummy_type.pb.h"
Expand Down

0 comments on commit d9f4afc

Please sign in to comment.