this post was submitted on 08 Mar 2025
11 points (92.3% liked)
Rust Programming
9034 readers
1 users here now
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
This is too simplistic example to give any meaningful answer. What’s
Type? What’svalue? If it’si32and42than they both compile to the exact same thing. But ifTypeisDropthan the second will call the destructor on each iteration. (I’ve also written previously about similar example withBorrowedBuf^1^).