]> git.lizzy.rs Git - rust.git/commit
Convert Into to From assist
authorGraeme Coupar <grambo@grambo.me.uk>
Fri, 2 Apr 2021 13:00:56 +0000 (14:00 +0100)
committerGraeme Coupar <grambo@grambo.me.uk>
Sat, 3 Apr 2021 14:48:35 +0000 (15:48 +0100)
commitee0384901784b2cbe8d62f259f8598cc0fc7d306
treecd03b30c585b44eedd9e12b90617a4969bae5d81
parent71ef64b673595807ccb4b3f5b7ad6ea55e63645b
Convert Into to From assist

This adds a "Convert Into to From" assist, useful since clippy has
recently started adding lints on every `Into`.

It covers converting the signature, and converting any `self`/`Self`
references within the body to the correct types.

It does assume that every instance of `Into` can be converted to a
`From`, which I _think_ is the case now.  Let me know if there's
something I'm not thinking of and I can try and make it smarter.
crates/ide_assists/src/handlers/convert_into_to_from.rs [new file with mode: 0644]
crates/ide_assists/src/lib.rs
crates/ide_assists/src/tests/generated.rs
crates/ide_db/src/helpers.rs
crates/ide_db/src/helpers/famous_defs_fixture.rs