• 0 Posts
  • 1 Comment
Joined 2 days ago
cake
Cake day: March 13th, 2025

help-circle
  • mina86toRust Programming@lemmy.mlWhich is faster?
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 days ago

    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).