What's the difference between a constant, and regular immutable variable, and a static variable in Rust?

后端 未结 0 1405
自闭症患者
自闭症患者 2021-01-07 09:20

I\'m learning Rust, and so far, there appears to be 3 ways to declare variables:

const A:u8 = 42;
static A:u8 = 42;
let A:u8 = 42;

I get that

相关标签:
回答
  • 消灭零回复
提交回复
热议问题