Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/Variables/Rust/variables-1.rust
Normal file
8
Task/Variables/Rust/variables-1.rust
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
let var01; // The compiler will infer the type or the compiler will ask for type annotations if the type can't be inferred
|
||||
let var02: u32; // The compiler will check if a value is assigned to var02 before being used
|
||||
let var03 = 5; // The compiler will infer the type or it will fallback to i32
|
||||
let var04 = 5u8; // Initialization to unsigned 8 bit (u8) number 5
|
||||
let var05: i8 = 5; // Type annotation + Initialization
|
||||
let var06: u8 = 5u8; // Type annotation + Initialization
|
||||
var01 = var05; // This line makes the compiler infer var01 should be a signed 8 bit number (i8).
|
||||
var02 = 9u32; // Assigning to var02 after declaration
|
||||
9
Task/Variables/Rust/variables-2.rust
Normal file
9
Task/Variables/Rust/variables-2.rust
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
let mut var07;
|
||||
let mut var08: f32;
|
||||
let mut var09 = 1.5;
|
||||
let mut var10 = 2.5f32;
|
||||
let mut var11: f32 = 5.0;
|
||||
let mut var12: f64 = 5.0f64;
|
||||
var07 = var11; // This line makes the compiler infer var07 should be a f32.
|
||||
var08 = 3.1416f32; // Assigning to var08 after declaration
|
||||
var08 = 2.7183f32; // Reassigning var08 since it can be reassigned since it is mutable.
|
||||
2
Task/Variables/Rust/variables-3.rust
Normal file
2
Task/Variables/Rust/variables-3.rust
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
let _notused = 10;
|
||||
let mut _mutnotused = 42;
|
||||
Loading…
Add table
Add a link
Reference in a new issue