Is there a tool that can convert original trait bounds like this:
fn foo<V: Debug>(value: V) {
// ...
}
to the "newer" (2014) where clause:
fn foo<V>(value: V)
where
V: Debug,
{
// ...
}
?
This is mostly a stylistic choice; since discussions around those can raise tensions, being able to enforce this (f.e. in CI) would be valuable. Can rustfmt
or clippy
do this?
Rust-analyzer can do this. In VSCode, if you put the cursor in the angle brackets and run quick-fix (cmd/ctrl. by default), Rust analyzer will suggest moving the bound to a where clause, as shown below.