This is (should be) the exact equivalent of the Cilia code in Rust:
- Types
isize,i32,i64,f32
- Variables
let mut x: i64 = 42;let mut x = 42;let x = 42;let mut words = Vec::<String>::new();let mut names = HashSet::<String>::new();let mut contactInfoForID = HashMap::<String, ContactInfo>::new();
- Functions
fn multiply(a: i64, b: i64) -> i64 { a * b }fn print(a: &ContactInfo) { ...; }fn concat(a: &str, b: &str) -> String { return ...; }
- Loops
for i in 1..=10 { ...; }for i in 0..words.len() { ...; }for i in [5, 7, 11, 13].iter() { ...; }for word in words.iter() { ...; }
Note
In Rust42is ani32, not ani64.