Skip to content

Commit 2efca23

Browse files
committed
revert: keep [[nodiscard]] on pre-existing SchemaField methods
Per scope feedback, only drop [[nodiscard]] from this PR's own additions (the default getters). Restore it on the pre-existing field_id/name/type/optional/ToString/Equals; the broader [[nodiscard]] cleanup belongs in a separate PR.
1 parent 6fe4640 commit 2efca23

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/iceberg/schema_field.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,16 @@ class ICEBERG_EXPORT SchemaField : public iceberg::util::Formattable {
7474
std::shared_ptr<const Literal> write_default = nullptr);
7575

7676
/// \brief Get the field ID.
77-
int32_t field_id() const;
77+
[[nodiscard]] int32_t field_id() const;
7878

7979
/// \brief Get the field name.
80-
std::string_view name() const;
80+
[[nodiscard]] std::string_view name() const;
8181

8282
/// \brief Get the field type.
83-
const std::shared_ptr<Type>& type() const;
83+
[[nodiscard]] const std::shared_ptr<Type>& type() const;
8484

8585
/// \brief Get whether the field is optional.
86-
bool optional() const;
86+
[[nodiscard]] bool optional() const;
8787

8888
/// \brief Get the field documentation.
8989
std::string_view doc() const;
@@ -96,7 +96,7 @@ class ICEBERG_EXPORT SchemaField : public iceberg::util::Formattable {
9696
/// does not supply a value (v3 `write-default`), or null if absent.
9797
const std::shared_ptr<const Literal>& write_default() const;
9898

99-
std::string ToString() const override;
99+
[[nodiscard]] std::string ToString() const override;
100100

101101
Status Validate() const;
102102

@@ -118,7 +118,7 @@ class ICEBERG_EXPORT SchemaField : public iceberg::util::Formattable {
118118

119119
private:
120120
/// \brief Compare two fields for equality.
121-
bool Equals(const SchemaField& other) const;
121+
[[nodiscard]] bool Equals(const SchemaField& other) const;
122122

123123
int32_t field_id_;
124124
std::string name_;

0 commit comments

Comments
 (0)