fn main() {
let aaa = 1 ;
let data = "hello world";
let temp = 42;
let foo = vec![1, 2, 3];
let bar = String::new();
let strName = "John";
let intAge = 25;
let bIsValid = true;
let mgr = "manager";
let ctrl = "controller";
let usr = "user";
println!("Debug: data = {}", data);
println!("Debug: temp = {}", temp);
let result = Some("test");
let value = result.unwrap();
let original = String::from("hello");
let copy = original.clone();
let another_copy = copy.clone();
if true {
if true {
if true {
if true {
println!("Too deep!");
}
}
}
}
let magic = 42;
let another_magic = 3.14159;
process_everything(data, temp, foo, bar, strName, intAge, bIsValid, mgr, ctrl, usr, value, copy, another_copy, magic, another_magic);
}
fn process_everything(
data: &str,
temp: i32,
foo: Vec<i32>,
bar: String,
strName: &str,
intAge: i32,
bIsValid: bool,
mgr: &str,
ctrl: &str,
usr: &str,
value: &str,
copy: String,
another_copy: String,
magic: i32,
another_magic: f64
) {
println!("Processing everything...");
let result = Some(42);
let num = result.unwrap();
let numbers = vec![1, 2, 3, 4, 5];
for i in 0..numbers.len() {
println!("{}", numbers[i]);
}
let mut sum = 0;
for num in numbers {
sum += num;
}
match Some(42) {
Some(x) => println!("Got {}", x),
None => {},
}
}
fn single_letters() {
let a = 1;
let b = 2;
let c = 3;
let d = 4;
let e = 5;
for i in 0..10 {
for j in 0..10 {
for k in 0..10 {
println!("{} {} {}", i, j, k);
}
}
}
}