Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Dec 12, 2023
1 parent de58fa4 commit e5e2678
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <boost/serialization/strong_typedef.hpp>

#include <cstdint>
#include <optional>
#include <ostream>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class JsonDeserializer final : public data_interfaces::IDataReader {
template <typename Item>
static tl::expected<data_model::ItemDescriptor<Item>,
data_interfaces::IDataReader::Error>
IntoStorageItem(integrations::SerializedItemDescriptor const& descriptor) {
DeserializeJsonDescriptor(
integrations::SerializedItemDescriptor const& descriptor) {
if (descriptor.deleted) {
return data_model::ItemDescriptor<Item>(
data_model::Tombstone(descriptor.version));
Expand Down Expand Up @@ -90,7 +91,7 @@ class JsonDeserializer final : public data_interfaces::IDataReader {
return std::nullopt;
}

return IntoStorageItem<DataModel>(*serialized_item);
return DeserializeJsonDescriptor<DataModel>(*serialized_item);
}

template <typename DataModel, typename DataKind>
Expand All @@ -106,7 +107,7 @@ class JsonDeserializer final : public data_interfaces::IDataReader {
Collection<DataModel> items;

for (auto const& [key, descriptor] : *result) {
auto item = IntoStorageItem<DataModel>(descriptor);
auto item = DeserializeJsonDescriptor<DataModel>(descriptor);

if (!item) {
LD_LOG(logger_, LogLevel::kError)
Expand Down
3 changes: 2 additions & 1 deletion libs/server-sdk/tests/json_destination_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ TEST_F(JsonDestinationTest, UpsertDeletedSegmentCreatesTombstone) {
2, "{\"key\":\"segment\",\"version\":2,\"deleted\":true}")))
.WillOnce(Return(ISerializedDestination::UpsertResult::kSuccess));

dest.Upsert("segment", data_model::SegmentDescriptor(data_model::Tombstone(2)));
dest.Upsert("segment",
data_model::SegmentDescriptor(data_model::Tombstone(2)));
}

TEST_F(JsonDestinationTest, UpsertFlagCreatesSerializedItem) {
Expand Down

0 comments on commit e5e2678

Please sign in to comment.