This is too simplistic example to give any meaningful answer. What’s Type? What’s value? If it’s i32 and 42 than they both compile to the exact same thing. But if Type is Drop than the second will call the destructor on each iteration. (I’ve also written previously about similar example with BorrowedBuf1).
This is too simplistic example to give any meaningful answer. What’s
Type
? What’svalue
? If it’si32
and42
than they both compile to the exact same thing. But ifType
isDrop
than the second will call the destructor on each iteration. (I’ve also written previously about similar example withBorrowedBuf
1).