Skip to content

Commit c589d80

Browse files
yoneyfacebook-github-bot
authored andcommitted
Apply clang-tidy modernize-concat-nested-namespaces
Summary: Apply [modernize-concat-nested-namespaces](https://clang.llvm.org/extra/clang-tidy/checks/modernize/concat-nested-namespaces.html)(C++17) check to `thrift/lib/cpp2`. Reviewed By: thedavekwon Differential Revision: D63978465 fbshipit-source-id: 5b0a68242d894eaa0349ed1308833037aeccc87e
1 parent 3fec909 commit c589d80

File tree

333 files changed

+704
-1706
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

333 files changed

+704
-1706
lines changed

third-party/thrift/src/thrift/lib/cpp2/Adapt.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
#include <thrift/lib/cpp/Field.h>
2626
#include <thrift/lib/cpp2/Thrift.h>
2727

28-
namespace apache {
29-
namespace thrift {
30-
namespace adapt_detail {
28+
namespace apache::thrift::adapt_detail {
3129

3230
// Identical to std::declval<const T&>.
3331
template <typename T>
@@ -526,6 +524,4 @@ uint32_t serializedSize(Protocol& prot, const AdaptedT& val, FallbackF f) {
526524
FallbackF>()(prot, val, f);
527525
}
528526

529-
} // namespace adapt_detail
530-
} // namespace thrift
531-
} // namespace apache
527+
} // namespace apache::thrift::adapt_detail

third-party/thrift/src/thrift/lib/cpp2/Adapter.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
#include <thrift/lib/cpp2/Thrift.h>
2121
#include <thrift/lib/cpp2/op/Clear.h>
2222

23-
namespace apache {
24-
namespace thrift {
23+
namespace apache::thrift {
2524
namespace adapt_detail {
2625

2726
// Used to detect if an adapted type has a reset method.
@@ -121,5 +120,4 @@ struct InlineAdapter {
121120
}
122121
};
123122

124-
} // namespace thrift
125-
} // namespace apache
123+
} // namespace apache::thrift

third-party/thrift/src/thrift/lib/cpp2/BoxedValuePtr.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@
3131
#define THRIFT_CONSTEXPR_IF_NOT_MSVC constexpr
3232
#endif
3333

34-
namespace apache {
35-
namespace thrift {
36-
namespace detail {
34+
namespace apache::thrift::detail {
3735

3836
// boxed_value_ptr will soon be replaced with boxed_value (defined below).
3937
template <typename T>
@@ -386,8 +384,6 @@ class boxed_value : public boost::totally_ordered<boxed_value<T>>,
386384
boxed_ptr<T> ptr_;
387385
};
388386

389-
} // namespace detail
390-
} // namespace thrift
391-
} // namespace apache
387+
} // namespace apache::thrift::detail
392388

393389
#undef THRIFT_CONSTEXPR_IF_NOT_MSVC

third-party/thrift/src/thrift/lib/cpp2/CloneableIOBuf.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
#include <folly/io/IOBuf.h>
2323
#include <thrift/lib/cpp/Thrift.h>
2424

25-
namespace apache {
26-
namespace thrift {
25+
namespace apache::thrift {
2726

2827
namespace detail {
2928

@@ -85,7 +84,6 @@ void swap(
8584

8685
typedef apache::thrift::detail::CloneableUniquePtr<folly::IOBuf> CloneableIOBuf;
8786

88-
} // namespace thrift
89-
} // namespace apache
87+
} // namespace apache::thrift
9088

9189
#endif // #ifndef THRIFT_CLONEABLE_IOBUF_H_

third-party/thrift/src/thrift/lib/cpp2/FieldRef.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
#include <thrift/lib/cpp2/FieldRefTraits.h>
3333
#include <thrift/lib/cpp2/Thrift.h>
3434

35-
namespace apache {
36-
namespace thrift {
35+
namespace apache::thrift {
3736
namespace detail {
3837

3938
template <typename T>
@@ -2505,5 +2504,4 @@ bool operator>=(const T& lhs, terse_field_ref<U> rhs) {
25052504
return lhs >= *rhs;
25062505
}
25072506

2508-
} // namespace thrift
2509-
} // namespace apache
2507+
} // namespace apache::thrift

third-party/thrift/src/thrift/lib/cpp2/FieldRefHash.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,9 @@
2222
#include <folly/Traits.h>
2323
#include <thrift/lib/cpp2/FieldRef.h>
2424

25-
namespace apache {
26-
namespace thrift {
27-
namespace detail {
25+
namespace apache::thrift::detail {
2826
const size_t kHashValueForNonExistsOptionalField = -3333;
29-
} // namespace detail
30-
} // namespace thrift
31-
} // namespace apache
27+
} // namespace apache::thrift::detail
3228

3329
namespace folly {
3430
template <class T>

third-party/thrift/src/thrift/lib/cpp2/FieldRefTraits.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
#include <memory>
2020
#include <folly/Traits.h>
21-
namespace apache {
22-
namespace thrift {
21+
22+
namespace apache::thrift {
2323

2424
template <class T>
2525
class field_ref;
@@ -92,5 +92,4 @@ inline constexpr bool is_optional_or_union_field_ref_v =
9292
is_union_field_ref_v<T>;
9393

9494
} // namespace detail
95-
} // namespace thrift
96-
} // namespace apache
95+
} // namespace apache::thrift

third-party/thrift/src/thrift/lib/cpp2/Flags.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ FlagsRegistry* getFlagsRegistry() {
7979
}
8080
} // namespace
8181

82-
namespace apache {
83-
namespace thrift {
82+
namespace apache::thrift {
8483
namespace detail {
8584
namespace {
8685

@@ -152,5 +151,4 @@ std::vector<ThriftFlagInfo> getAllThriftFlags() {
152151
return getFlagsRegistry()->getAllThriftFlags();
153152
}
154153

155-
} // namespace thrift
156-
} // namespace apache
154+
} // namespace apache::thrift

third-party/thrift/src/thrift/lib/cpp2/Flags.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030

3131
#include <thrift/lib/cpp2/PluggableFunction.h>
3232

33-
namespace apache {
34-
namespace thrift {
33+
namespace apache::thrift {
3534
namespace detail {
3635

3736
class FlagsBackend {
@@ -200,5 +199,4 @@ struct ThriftFlagInfo {
200199
};
201200

202201
std::vector<ThriftFlagInfo> getAllThriftFlags();
203-
} // namespace thrift
204-
} // namespace apache
202+
} // namespace apache::thrift

third-party/thrift/src/thrift/lib/cpp2/GeneratedCodeHelper.cpp

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ using namespace std;
3535
using namespace folly;
3636
using namespace apache::thrift::transport;
3737

38-
namespace apache {
39-
namespace thrift {
38+
namespace apache::thrift {
4039

4140
namespace detail {
4241

@@ -48,8 +47,7 @@ THRIFT_PLUGGABLE_FUNC_REGISTER(
4847

4948
} // namespace detail
5049

51-
namespace detail {
52-
namespace ac {
50+
namespace detail::ac {
5351

5452
[[noreturn]] void throw_app_exn(const char* const msg) {
5553
throw TApplicationException(msg);
@@ -86,11 +84,9 @@ folly::exception_wrapper try_extract_any_exception(
8684
return {};
8785
}
8886

89-
} // namespace ac
90-
} // namespace detail
87+
} // namespace detail::ac
9188

92-
namespace detail {
93-
namespace ap {
89+
namespace detail::ap {
9490

9591
template <typename ProtocolReader, typename ProtocolWriter>
9692
std::unique_ptr<folly::IOBuf> helper<ProtocolReader, ProtocolWriter>::write_exn(
@@ -243,11 +239,9 @@ MessageBegin deserializeMessageBegin(
243239
}
244240
return msgBegin;
245241
}
246-
} // namespace ap
247-
} // namespace detail
242+
} // namespace detail::ap
248243

249-
namespace detail {
250-
namespace si {
244+
namespace detail::si {
251245
namespace {
252246
TrustedServerException createUnimplementedMethodException(
253247
std::string_view methodName) {
@@ -264,8 +258,7 @@ folly::exception_wrapper create_app_exn_unimplemented(const char* name) {
264258
[[noreturn]] void throw_app_exn_unimplemented(const char* const name) {
265259
throw createUnimplementedMethodException(name);
266260
}
267-
} // namespace si
268-
} // namespace detail
261+
} // namespace detail::si
269262

270263
namespace {
271264

@@ -354,5 +347,4 @@ bool includeInRecentRequestsCount(const std::string_view methodName) {
354347

355348
} // namespace util
356349

357-
} // namespace thrift
358-
} // namespace apache
350+
} // namespace apache::thrift

0 commit comments

Comments
 (0)