Skip to content

Commit

Permalink
Move TypeToMaskAdapter into protocol::detail namespace
Browse files Browse the repository at this point in the history
Summary: As title

Reviewed By: thedavekwon

Differential Revision: D62193781

fbshipit-source-id: 66b1f98b75569811b499922c9ebe95ffa151d160
  • Loading branch information
Pranav Thulasiram Bhat authored and facebook-github-bot committed Sep 6, 2024
1 parent c217470 commit 97da28e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions thrift/lib/thrift/TypeToMaskAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

#include <thrift/lib/cpp2/protocol/DebugProtocol.h>

namespace apache::thrift::detail {
namespace apache::thrift::protocol::detail {

std::string debugFormatType(const type::Type& type) {
return debugStringViaEncode(type);
}

} // namespace apache::thrift::detail
} // namespace apache::thrift::protocol::detail
4 changes: 2 additions & 2 deletions thrift/lib/thrift/TypeToMaskAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <folly/container/F14Map.h>
#include <thrift/lib/thrift/gen-cpp2/type_types.h>

namespace apache::thrift::detail {
namespace apache::thrift::protocol::detail {

std::string debugFormatType(const type::Type& type);

Expand Down Expand Up @@ -75,4 +75,4 @@ class TypeToMaskAdapter {
// materializing intermediate thrift struct)
};

} // namespace apache::thrift::detail
} // namespace apache::thrift::protocol::detail
2 changes: 1 addition & 1 deletion thrift/lib/thrift/field_mask.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct TypeAndMaskEntry {
* given type within the list
*/
@cpp.Adapter{
name = "::apache::thrift::detail::TypeToMaskAdapter<
name = "::apache::thrift::protocol::detail::TypeToMaskAdapter<
::apache::thrift::protocol::TypeAndMaskEntry,
::apache::thrift::protocol::Mask
>",
Expand Down
5 changes: 2 additions & 3 deletions thrift/test/FieldMaskTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3532,9 +3532,8 @@ TEST(FieldMaskTest, testDuplicateEntryInTypeMaskList) {
entries.emplace_back().type() = type::infer_tag<Foo>{};

EXPECT_THROW(
(::apache::thrift::detail::
TypeToMaskAdapter<protocol::TypeAndMaskEntry, Mask>::fromThrift(
std::move(entries))),
(protocol::detail::TypeToMaskAdapter<protocol::TypeAndMaskEntry, Mask>::
fromThrift(std::move(entries))),
std::runtime_error);
}

Expand Down

0 comments on commit 97da28e

Please sign in to comment.