@snaggen to Rust • 4 months agoAnnouncing Rust 1.79.0blog.rust-lang.orgexternal-linkmessage-square3arrow-up179arrow-down11cross-posted to: [email protected]
arrow-up178arrow-down1external-linkAnnouncing Rust 1.79.0blog.rust-lang.org@snaggen to Rust • 4 months agomessage-square3cross-posted to: [email protected]
minus-square@[email protected]linkfedilink2•4 months agoI don’t understand what the advantages of const expressions are. Isn’t const { None } the same as just None?
minus-square@[email protected]linkfedilink7•4 months agoconst expressions are evaluated at compile time and can be used in locations where you would have to otherwise specify a literal (or something that amounts to a named literal like a const value).
I don’t understand what the advantages of const expressions are.
Isn’t
const { None }
the same as justNone
?const expressions are evaluated at compile time and can be used in locations where you would have to otherwise specify a literal (or something that amounts to a named literal like a const value).