Skip to content

Commit dbda110

Browse files
author
Innocent
committed
clang-format
1 parent ef343ad commit dbda110

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

src/iceberg/expression/json_internal.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434
namespace iceberg {
3535

36-
3736
Result<std::shared_ptr<Expression>> ExpressionFromJson(const nlohmann::json& json) {
3837
// Handle boolean literals
3938
if (json.is_boolean()) {
@@ -55,10 +54,10 @@ nlohmann::json ToJson(const Expression& expr) {
5554
}
5655
}
5756

58-
#define ICEBERG_DEFINE_FROM_JSON(Model) \
59-
template <> \
57+
#define ICEBERG_DEFINE_FROM_JSON(Model) \
58+
template <> \
6059
Result<std::shared_ptr<Model>> FromJson<Model>(const nlohmann::json& json) { \
61-
return Model##FromJson(json); \
60+
return Model##FromJson(json); \
6261
}
6362

6463
ICEBERG_DEFINE_FROM_JSON(Expression)

src/iceberg/expression/json_internal.h

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

3131
namespace iceberg {
3232

33-
3433
template <typename Model>
3534
Result<Model> FromJson(const nlohmann::json& json);
3635

37-
#define ICEBERG_DECLARE_JSON_SERDE(Model) \
38-
Result<std::shared_ptr<Model>> Model##FromJson(const nlohmann::json& json); \
39-
\
40-
template <typename Model> \
41-
Result<std::shared_ptr<Model>> FromJson(const nlohmann::json& json); \
42-
\
43-
nlohmann::json ToJson(const Model& model);
36+
#define ICEBERG_DECLARE_JSON_SERDE(Model) \
37+
Result<std::shared_ptr<Model>> Model##FromJson(const nlohmann::json& json); \
38+
\
39+
template <typename Model> \
40+
Result<std::shared_ptr<Model>> FromJson(const nlohmann::json& json); \
41+
\
42+
nlohmann::json ToJson(const Model& model);
4443

4544
/// \note Don't forget to add `ICEBERG_DEFINE_FROM_JSON` to the end of
4645
/// `json_internal.cc` to define the `FromJson` function for the model.

src/iceberg/test/expression_json_test.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
* under the License.
1818
*/
1919

20-
#include "iceberg/expression/json_internal.h"
21-
2220
#include <memory>
2321
#include <vector>
2422

@@ -28,6 +26,7 @@
2826

2927
#include "iceberg/expression/expression.h"
3028
#include "iceberg/expression/expressions.h"
29+
#include "iceberg/expression/json_internal.h"
3130
#include "iceberg/expression/literal.h"
3231
#include "iceberg/expression/predicate.h"
3332
#include "iceberg/expression/term.h"

0 commit comments

Comments
 (0)