"Convert `as X` to `X::from`" assist
It would be useful if rust-analyzer had an assist that allows quickly changing an as x cast to an x::from-style cast (when the appropriate From impl exists). This would save a bunch of typing when refactoring casts to be more precise (since as _ will wrap).
Additionally, it could also offer a conversion to .try_into().unwrap() when there is only a TryFrom/TryInto impl but no From/Into impl, since that's a common change too.
@ShoyuVanilla @ChayimFriedman2 I have raised a PR for this issue. Thanks !
@benodiwal It is not clear that we want to accept new assists currently, or this assist at all. While creating a PR is fine, it'd be better (for you, to not waste work) if you would've discussed with team members whether we want that instead of jumping to implementing it.
Got it, I’ll be careful about this going forward.