Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions src/iceberg/type.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,7 @@ ListType::ListType(int32_t field_id, std::shared_ptr<Type> type, bool optional)
: element_(field_id, std::string(kElementName), std::move(type), optional) {}

TypeId ListType::type_id() const { return kTypeId; }
std::string ListType::ToString() const {
// XXX: work around Clang/libc++: "<{}>" in a format string appears to get
// parsed as {<>} or something; split up the format string to avoid that
std::string repr = "list<";
std::format_to(std::back_inserter(repr), "{}", element_);
repr += ">";
return repr;
}
std::string ListType::ToString() const { return std::format("list<{}>", element_); }

std::span<const SchemaField> ListType::fields() const { return {&element_, 1}; }
Result<std::optional<NestedType::SchemaFieldConstRef>> ListType::GetFieldById(
Expand Down Expand Up @@ -213,13 +206,7 @@ const SchemaField& MapType::value() const { return fields_[1]; }
TypeId MapType::type_id() const { return kTypeId; }

std::string MapType::ToString() const {
// XXX: work around Clang/libc++: "<{}>" in a format string appears to get
// parsed as {<>} or something; split up the format string to avoid that
std::string repr = "map<";

std::format_to(std::back_inserter(repr), "{}: {}", key(), value());
repr += ">";
return repr;
return std::format("map<{}: {}>", key(), value());
}

std::span<const SchemaField> MapType::fields() const { return fields_; }
Expand Down
Loading