1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-07-13 17:44:20 +02:00
Files
comprehensive-rust/src/basic-syntax/variables.md

14 lines
225 B
Markdown
Raw Normal View History

2022-12-21 16:36:30 +01:00
# Variables
Rust provides type safety via static typing. Variable bindings are immutable by
default:
```rust,editable
fn main() {
let x: i32 = 10;
println!("x: {x}");
// x = 20;
// println!("x: {x}");
}
```