xushiyan commented on code in PR #170:
URL: https://github.com/apache/hudi-rs/pull/170#discussion_r1807450725
##########
python/src/internal.rs:
##########
@@ -30,12 +30,17 @@ use hudi::file_group::FileSlice;
use hudi::table::builder::TableBuilder;
use hudi::table::Table;
-macro_rules! vec_string_to_slice {
+fn convert_vec_to_slice(vec: &[(String, String, String)]) -> Vec<(&str, &str,
&str)> {
+ vec.iter()
+ .map(|(a, b, c)| (a.as_str(), b.as_str(), c.as_str()))
+ .collect()
+}
+
+macro_rules! vec_to_slice {
($vec:expr) => {
- &$vec.iter().map(AsRef::as_ref).collect::<Vec<_>>()
+ &convert_vec_to_slice(&$vec)[..]
};
}
Review Comment:
@kazdy this is a generic util that should be placed under common for all
modules to use. python does not mimic rust for every util, it imports when
needed.
--
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]