Compare commits

...

2 Commits

Author SHA1 Message Date
7f4f627769
Much renaming and refreshing of RBE 2023-09-24 20:46:41 -04:00
dc8045a20e
Trivial goop while refreshing on RBE 2023-09-24 10:57:16 -04:00
30 changed files with 38 additions and 29 deletions

View File

@ -1,11 +1,6 @@
/custom_types/*
/hello/*
/primitives/*
/variable_bindings/*
/types/*
/*.d/*
hello
primitives
variable_bindings
!/custom_types/*.rs
!/hello/*.rs
!/primitives/*.rs
!/variable_bindings/*.rs
!/types/*.rs
!/*.d/*.rs

View File

@ -1,3 +1,4 @@
#[allow(dead_code)]
#[derive(Debug)]
struct Person {
name: String,

View File

@ -1,3 +1,4 @@
#[allow(dead_code)]
#[derive(Debug)]
struct Person<'a> {
name: &'a str,

View File

@ -20,6 +20,6 @@ impl fmt::Display for List {
}
fn main() {
let v = List(vec![1, 2, 3]);
let v = List(vec![6, 0, 6, 8, 0, 8, 9, 1, 1, 1, 3, 1, 2]);
println!("{}", v);
}

View File

@ -22,5 +22,14 @@ fn main() {
println!("borrow a section of the array as a slice");
analyze_slice(&ys[1..4]);
// println!("{}", xs[5]);
let empty_array: [u32; 0] = [];
assert_eq!(&empty_array, &[]);
assert_eq!(&empty_array, &[][..]);
for i in 0..xs.len() + 1 {
match xs.get(i) {
Some(xval) => println!("{}: {}", i, xval),
None => println!("Slow down! {} is too far!", i),
}
}
}

View File

@ -3,6 +3,8 @@ fn main() {
println!("1 - 2 = {}", 1i32 - 2);
println!("1e4 is {}, -2.5e-3 is {}", 1e4, -2.5e-3);
println!("true AND false is {}", true && false);
println!("true OR false is {}", true || false);
println!("NOT true is {}", !true);

View File

@ -1,3 +1,5 @@
#[allow(unused_variables)]
#[allow(unused_assignments)]
fn main() {
let logical: bool = true;

View File

@ -0,0 +1,15 @@
type NanoSecond = u64;
type Inch = u64;
type U64 = u64;
fn main() {
let nanoseconds: NanoSecond = 5 as U64;
let inches: Inch = 2 as U64;
println!(
"{} nanoseconds + {} inches = {} unit?",
nanoseconds,
inches,
nanoseconds + inches
);
}

View File

@ -1,15 +0,0 @@
type NanoSecond = u64;
type Inch = u64;
#[allow(non_camel_case_types)]
type u64_t = u64;
fn main() {
let nanoseconds: NanoSecond = 5 as u64_t;
let inches: Inch = 2 as u64_t;
println!("{} nanoseconds + {} inches = {} unit?",
nanoseconds,
inches,
nanoseconds + inches);
}

View File

@ -13,4 +13,3 @@ fn main() {
let shadowed_binding = 2;
println!("shadowed in outer block: {}", shadowed_binding);
}

View File

@ -11,5 +11,5 @@ fn main() {
let _unused_variable = 3u32;
let noisy_unused_variable = 2u32;
let _noisy_unused_variable = 2u32;
}