Commit bbc51806 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Apply clang-format to folly/gen/ (partial: namespace)

Summary:
[Folly] Apply `clang-format` to `folly/gen/` (partial: namespace).

With some manual rearrangement in the places where `clang-format` does awkward things, with the result that clang-format over `folly/gen/` becomes a no-op.

Reviewed By: Orvid

Differential Revision: D5177428

fbshipit-source-id: 17f51d00454a7be7f29dcf1a2ff3d0eaf1de72ab
parent 1b67e9aa
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow" #pragma GCC diagnostic ignored "-Wshadow"
namespace folly { namespace gen { namespace folly {
namespace gen {
/** /**
* ArgumentReference - For determining ideal argument type to receive a value. * ArgumentReference - For determining ideal argument type to receive a value.
...@@ -2336,7 +2337,7 @@ inline detail::Skip skip(size_t count) { return detail::Skip(count); } ...@@ -2336,7 +2337,7 @@ inline detail::Skip skip(size_t count) { return detail::Skip(count); }
inline detail::Batch batch(size_t batchSize) { inline detail::Batch batch(size_t batchSize) {
return detail::Batch(batchSize); return detail::Batch(batchSize);
} }
} // gen
}} // folly::gen } // folly
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
...@@ -78,9 +78,10 @@ ...@@ -78,9 +78,10 @@
* *
* To learn more about this library, including the use of infinite generators, * To learn more about this library, including the use of infinite generators,
* see the examples in the comments, or the docs (coming soon). * see the examples in the comments, or the docs (coming soon).
*/ */
namespace folly { namespace gen { namespace folly {
namespace gen {
class Less { class Less {
public: public:
...@@ -814,7 +815,7 @@ template<class Fallback, ...@@ -814,7 +815,7 @@ template<class Fallback,
UnwrapOr unwrapOr(Fallback&& fallback) { UnwrapOr unwrapOr(Fallback&& fallback) {
return UnwrapOr(std::forward<Fallback>(fallback)); return UnwrapOr(std::forward<Fallback>(fallback));
} }
} // gen
}} // folly::gen } // folly
#include <folly/gen/Base-inl.h> #include <folly/gen/Base-inl.h>
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow" #pragma GCC diagnostic ignored "-Wshadow"
namespace folly { namespace gen { namespace folly {
namespace gen {
/** /**
* IsCompatibleSignature - Trait type for testing whether a given Functor * IsCompatibleSignature - Trait type for testing whether a given Functor
...@@ -372,7 +373,7 @@ public: ...@@ -372,7 +373,7 @@ public:
}; };
} // detail } // detail
} // gen
}} // folly::gen } // folly
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
#pragma once #pragma once
#define FOLLY_GEN_CORE_H_ #define FOLLY_GEN_CORE_H_
namespace folly { namespace gen { namespace folly {
namespace gen {
template<class Value, class Self> template<class Value, class Self>
class GenImpl; class GenImpl;
...@@ -37,7 +38,7 @@ template<class Value, class First, class Second> ...@@ -37,7 +38,7 @@ template<class Value, class First, class Second>
class Chain; class Chain;
} // detail } // detail
} // gen
}} // folly::gen } // folly
#include <folly/gen/Core-inl.h> #include <folly/gen/Core-inl.h>
...@@ -161,4 +161,5 @@ inline auto byLine(int fd, char delim = '\n') ...@@ -161,4 +161,5 @@ inline auto byLine(int fd, char delim = '\n')
inline auto byLine(const char* f, char delim = '\n') inline auto byLine(const char* f, char delim = '\n')
-> decltype(byLine(File(f), delim)) { return byLine(File(f), delim); } -> decltype(byLine(File(f), delim)) { return byLine(File(f), delim); }
}} // !folly::gen } // !gen
} // !folly
...@@ -64,7 +64,7 @@ template <class S = detail::FileWriter> ...@@ -64,7 +64,7 @@ template <class S = detail::FileWriter>
S toFile(File file, std::unique_ptr<IOBuf> buffer) { S toFile(File file, std::unique_ptr<IOBuf> buffer) {
return S(std::move(file), std::move(buffer)); return S(std::move(file), std::move(buffer));
} }
} // !gen
}} // !folly::gen } // !folly
#include <folly/gen/File-inl.h> #include <folly/gen/File-inl.h>
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
#include <folly/gen/Base.h> #include <folly/gen/Base.h>
namespace folly { namespace gen { namespace folly {
namespace gen {
namespace detail { namespace detail {
template <class Ops> template <class Ops>
...@@ -102,7 +103,7 @@ template <class Sink, class Sub = detail::Sub<Sink>> ...@@ -102,7 +103,7 @@ template <class Sink, class Sub = detail::Sub<Sink>>
Sub sub(Sink sink) { Sub sub(Sink sink) {
return Sub(std::move(sink)); return Sub(std::move(sink));
} }
} // !namespace gen
}} // !namespace folly::gen } // !namespace folly
#include <folly/gen/Parallel-inl.h> #include <folly/gen/Parallel-inl.h>
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,9 @@
#include <folly/MPMCPipeline.h> #include <folly/MPMCPipeline.h>
#include <folly/experimental/EventCount.h> #include <folly/experimental/EventCount.h>
namespace folly { namespace gen { namespace detail { namespace folly {
namespace gen {
namespace detail {
/** /**
* PMap - Map in parallel (using threads). For producing a sequence of * PMap - Map in parallel (using threads). For producing a sequence of
...@@ -250,5 +252,6 @@ class PMap : public Operator<PMap<Predicate>> { ...@@ -250,5 +252,6 @@ class PMap : public Operator<PMap<Predicate>> {
return Gen(source.self(), pred_, nThreads_); return Gen(source.self(), pred_, nThreads_);
} }
}; };
} // namespace detail
}}} // namespaces } // namespace gen
} // namespace folly
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
#include <folly/gen/Core.h> #include <folly/gen/Core.h>
namespace folly { namespace gen { namespace folly {
namespace gen {
namespace detail { namespace detail {
...@@ -42,7 +43,7 @@ template<class Predicate, ...@@ -42,7 +43,7 @@ template<class Predicate,
PMap pmap(Predicate pred = Predicate(), size_t nThreads = 0) { PMap pmap(Predicate pred = Predicate(), size_t nThreads = 0) {
return PMap(std::move(pred), nThreads); return PMap(std::move(pred), nThreads);
} }
} // namespace gen
}} // namespaces } // namespace folly
#include <folly/gen/ParallelMap-inl.h> #include <folly/gen/ParallelMap-inl.h>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment