Kontinuation commented on code in PR #492:
URL: https://github.com/apache/sedona-db/pull/492#discussion_r2676444188


##########
rust/sedona-expr/src/item_crs.rs:
##########
@@ -58,9 +58,36 @@ pub struct ItemCrsKernel {
 }
 
 impl ItemCrsKernel {
+    /// Create a new [ScalarKernelRef] wrapping the input
+    ///
+    /// The resulting kernel matches arguments of the input with ItemCrs inputs
+    /// but not those of the original kernel (i.e., a function needs both 
kernels
+    /// to support both type-level and item-level CRSes).
     pub fn new_ref(inner: ScalarKernelRef) -> ScalarKernelRef {
         Arc::new(Self { inner })
     }
+
+    /// Wrap a vector of kernels by appending all ItemCrs versions followed by
+    /// the contents of inner
+    ///
+    /// This is the recommended way to add kernels when all of them should 
support
+    /// ItemCrs inputs.
+    pub fn wrap_impl(inner: impl IntoScalarKernelRefs) -> Vec<ScalarKernelRef> 
{
+        let kernels = inner.into_scalar_kernel_refs();
+
+        let mut out = Vec::new();

Review Comment:
   ```suggestion
           let mut out = Vec::with_capacity(kernels.len() * 2);
   ```



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

Reply via email to