mirror of https://github.com/rust-lang/rustlings
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
458 B
Rust
20 lines
458 B
Rust
7 years ago
|
// primitive_types3.rs
|
||
1 year ago
|
//
|
||
4 years ago
|
// Create an array with at least 100 elements in it where the ??? is.
|
||
1 year ago
|
//
|
||
|
// Execute `rustlings hint primitive_types3` or use the `hint` watch subcommand
|
||
|
// for a hint.
|
||
9 years ago
|
|
||
5 years ago
|
// I AM NOT DONE
|
||
|
|
||
9 years ago
|
fn main() {
|
||
|
let a = ???
|
||
|
|
||
|
if a.len() >= 100 {
|
||
|
println!("Wow, that's a big array!");
|
||
|
} else {
|
||
|
println!("Meh, I eat arrays like that for breakfast.");
|
||
1 year ago
|
panic!("Array not big enough, more elements needed")
|
||
9 years ago
|
}
|
||
|
}
|