liurenjie1024 commented on code in PR #25:
URL: https://github.com/apache/iceberg-rust/pull/25#discussion_r1288067784
##########
crates/iceberg/src/spec/schema.rs:
##########
@@ -84,28 +206,853 @@ impl Schema {
pub fn schema_id(&self) -> i32 {
self.schema_id
}
+
+ /// Returns [`r#struct`].
+ #[inline]
+ pub fn as_struct(&self) -> &StructType {
+ &self.r#struct
+ }
+
+ /// Get field id by full name.
+ pub fn field_id_by_name(&self, name: &str) -> Option<i32> {
+ self.name_to_id.get(name).cloned()
Review Comment:
Yeah, `copied()` is better. Why clippy doesn't warn this 😁
##########
crates/iceberg/src/spec/schema.rs:
##########
@@ -84,28 +206,853 @@ impl Schema {
pub fn schema_id(&self) -> i32 {
self.schema_id
}
+
+ /// Returns [`r#struct`].
+ #[inline]
+ pub fn as_struct(&self) -> &StructType {
+ &self.r#struct
+ }
+
+ /// Get field id by full name.
+ pub fn field_id_by_name(&self, name: &str) -> Option<i32> {
+ self.name_to_id.get(name).cloned()
Review Comment:
Yeah, `copied()` is better. Why clippy doesn't warn this 😁
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]