Change the parameter types of ParamValues
's methods to avoid expensive conversion
#8612
Labels
bug
Something isn't working
Describe the bug
The parameter types of
ParamValues::{get_placeholders_with_values,verify}
could be changed to avoid expensive conversion on the caller side.Receiving
&[DataType]
instead of&Vec<DataType>
will allow the callers to pass an arbitrary slice without cloning it to a temporaryVec
first. Clippy has a lint for this:ptr_arg
&String
->&str
:ptr_arg
likewise.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 callOption::as_ref
, but the performance cost of this conversion is negligible. There's a work-in-progress Clippy lint for this: rust-lang/rust-clippy#11463To Reproduce
No response
Expected behavior
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: