crepererum commented on PR #19893:
URL: https://github.com/apache/datafusion/pull/19893#issuecomment-3798941044
A slightly more verbose trick to avoid the code bloat but still get the
`impl Into<...>`/`impl AsRef<...>` would be to split the respective methods
into a public and private part. Using an `impl Into<...>` example, then
something like:
```rust
pub fn foo(&self, param: String) -> ... {
...
}
```
would become
```rust
pub fn foo(&self, param: impl Into<String>) -> ... {
self.foo_impl(param.into())
}
fn foo_impl(&self, param: String) -> ... {
// that's just the "old" `foo` method
...
}
```
i.e. you basically control the generic part a bit more manual. That was what
once was planned (but no longer is) as an automatic step, see
https://github.com/rust-lang/rust/issues/124962
--
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]