Added more examples for Rust

This commit is contained in:
Eduardo Cueto Mendoza 2020-07-18 00:21:38 -06:00
parent b7a448ce36
commit 14784cd6a1
2 changed files with 35 additions and 3 deletions

View File

@ -1,9 +1,17 @@
//mod print; //mod print;
//mod vars; //mod vars;
mod types; //mod types;
//mod strings;
//mod tuples;
//mod arrays;
mod vectors;
fn main() { fn main() {
//print::run(); //print::run();
//vars::run(); //vars::run();
types::run(); //types::run();
//strings::run();
//tuples::run();
//arrays::run();
vectors::run();
} }

View File

@ -1 +1,25 @@
pub fn run() {} pub fn run() {
// will be by default i32
let x = 1;
// will be inferred as f32
let y = 2.5;
// add explicit type
let z: i64 = 453453;
// find max size
println!("Max i32: {}", std::i32::MAX);
println!("Max i64: {}", std::i64::MAX);
// Boolean
let is_active = true;
// get boolean from . expression
let is_greater: bool = 10 < 5;
// Char
let a1 = '\u{1F600}';
println!("{:?}",(x,y,z,is_active, is_greater,a1));
}