Skip to content

Commit e41463c

Browse files
put Unreachable outside
1 parent 4316c85 commit e41463c

3 files changed

Lines changed: 8 additions & 12 deletions

File tree

src/iceberg/json_internal.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,9 @@ nlohmann::json ToJson(const Type& type) {
477477
}
478478
case TypeId::kUuid:
479479
return "uuid";
480-
default:
481-
internal::Unreachable(std::format("Unknown type id: {}",
482-
static_cast<int>(type.type_id())));
483480
}
481+
internal::Unreachable(
482+
std::format("Unknown type id: {}", static_cast<int>(type.type_id())));
484483
}
485484

486485
nlohmann::json ToJson(const Schema& schema) {

src/iceberg/schema_util.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,9 @@ std::string_view ToString(FieldProjection::Kind kind) {
172172
return "default";
173173
case FieldProjection::Kind::kNull:
174174
return "null";
175-
default:
176-
internal::Unreachable(std::format("Unknown field projection kind: {}",
177-
static_cast<int>(kind)));
178175
}
176+
internal::Unreachable(
177+
std::format("Unknown field projection kind: {}", static_cast<int>(kind)));
179178
}
180179

181180
std::string ToString(const FieldProjection& projection) {

src/iceberg/transform.cc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ constexpr std::string_view TransformTypeToString(TransformType type) {
5959
return kHourName;
6060
case TransformType::kVoid:
6161
return kVoidName;
62-
default:
63-
internal::Unreachable(std::format("Unknown transform type: {}",
64-
static_cast<int>(type)));
6562
}
63+
internal::Unreachable(
64+
std::format("Unknown transform type: {}", static_cast<int>(type)));
6665
}
6766

6867
std::shared_ptr<Transform> Transform::Identity() {
@@ -169,10 +168,9 @@ std::string Transform::ToString() const {
169168
case TransformType::kTruncate:
170169
return std::format("{}[{}]", TransformTypeToString(transform_type_),
171170
std::get<int32_t>(param_));
172-
default:
173-
internal::Unreachable(std::format("Unknown transform type: {}",
174-
static_cast<int>(transform_type_)));
175171
}
172+
internal::Unreachable(
173+
std::format("Unknown transform type: {}", static_cast<int>(transform_type_)));
176174
}
177175

178176
TransformFunction::TransformFunction(TransformType transform_type,

0 commit comments

Comments
 (0)