Skip to content

Commit 6b5573b

Browse files
committed
Auto merge of #17991 - ChayimFriedman2:extract-variable-ref, r=Veykril
fix: Don't add reference when it isn't needed for the "Extract variable" assist I.e. don't generate `let var_name = &foo()`. Because it always irritates me when I need to fix that. Anything that creates a new value don't need a reference. That excludes mostly field accesses and indexing. I had a thought that we can also not generate a reference for fields and indexing as long as the type is `Copy`, but sometimes people impl `Copy` even when they don't want to copy the values (e.g. a large type), so I didn't do that.
2 parents 846154a + 2ceef12 commit 6b5573b

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)