kawadakk opened a new issue, #8612:
URL: https://github.com/apache/arrow-datafusion/issues/8612
### Describe the bug
The parameter types of `ParamValues::{get_placeholders_with_values,verify}`
could be changed to avoid expensive conversion on the caller side.
```rust
impl ParamValues {
pub fn verify(&self, expect: &Vec<DataType>) -> Result<()>;
}
```
Receiving `&[DataType]` instead of `&Vec<DataType>` will allow the callers
to pass an arbitrary slice without cloning it to a temporary `Vec` first.
Clippy has a lint for this:
[`ptr_arg`](https://rust-lang.github.io/rust-clippy/master/index.html#/ptr_arg)
```rust
impl ParamValues {
pub fn get_placeholders_with_values(
&self,
id: &String,
data_type: &Option<DataType>,
) -> Result<ScalarValue>;
}
```
`&String` -> `&str`: Ditto.
Receiving `Option<&DataType>` instead of `&Option<DataType>` will allow the
callers to avoid cloning when they only have `&DataType` at hand. If the
callers have `&Option<DataType>`, they will have to call `Option::as_ref`, but
the performance cost of this conversion is negligible. There's a
work-in-progress Clippy lint for this:
<https://github.com/rust-lang/rust-clippy/pull/11463>
### To Reproduce
_No response_
### Expected behavior
_No response_
### Additional context
_No response_
--
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]