anoopj commented on code in PR #3363:
URL: https://github.com/apache/iceberg-rust/pull/3363#discussion_r4235106860


##########
crates/iceberg/src/spec/snapshot_summary.rs:
##########
@@ -330,6 +331,14 @@ where T: PartialOrd + Default + ToString {
     }
 }
 
+pub(crate) fn set_iceberg_version(properties: &mut HashMap<String, String>) {
+    let version = env!("CARGO_PKG_VERSION");
+    properties.insert(
+        ICEBERG_VERSION_PROP.to_string(),
+        format!("Apache Iceberg Rust {version}"),
+    );
+}

Review Comment:
   Optional since this is not in the hot path, but since 
`env!("CARGO_PKG_VERSION")` is a compile-time `&'static str`, the whole value 
can be a const and skip the per-commit `format!`. ie something like:
   
   ```
   const ICEBERG_VERSION_VALUE: &str = concat!("Apache Iceberg Rust ", 
env!("CARGO_PKG_VERSION"));
   
   pub(crate) fn set_iceberg_version(properties: &mut HashMap<String, String>) {
       properties.insert(ICEBERG_VERSION_PROP.to_string(), 
ICEBERG_VERSION_VALUE.to_string());
   }
   ```



-- 
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]

Reply via email to