mirror of
https://git.aramjonghu.dev/AramJonghu/rustlings.git
synced 2026-09-04 09:13:30 +02:00
primitive_types3 solution
This commit is contained in:
@@ -1 +1,11 @@
|
||||
// Solutions will be available before the stable release. Thank you for testing the beta version 🥰
|
||||
fn main() {
|
||||
// An array with 100 elements of the value 42.
|
||||
let a = [42; 100];
|
||||
|
||||
if a.len() >= 100 {
|
||||
println!("Wow, that's a big array!");
|
||||
} else {
|
||||
println!("Meh, I eat arrays like that for breakfast.");
|
||||
panic!("Array not big enough, more elements needed");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user