mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-16 09:48:10 +00:00
59f8827a6f
This adds a new assist named "replace named generic with impl" to move the generic param type from the generic param list into the function signature. ```rust fn new<T: ToString>(input: T) -> Self {} ``` becomes ```rust fn new(input: impl ToString) -> Self {} ``` The first step is to determine if the assist can be applied, there has to be a match between generic trait param & function paramter types. * replace function parameter type(s) with impl * add new `impl_trait_type` function to generate the new trait bounds with `impl` keyword for use in the function signature |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |