rustlings

solving rustlings ft. dracuxan
git clone [email protected]:dracuxan/rustlings.git
Log | Files | Refs

primitive_types3.rs (304B)


      1 fn main() {
      2     // An array with 100 elements of the value 42.
      3     let a = [42; 100];
      4 
      5     if a.len() >= 100 {
      6         println!("Wow, that's a big array!");
      7     } else {
      8         println!("Meh, I eat arrays like that for breakfast.");
      9         panic!("Array not big enough, more elements needed");
     10     }
     11 }