February 2022
Intermediate to advanced
140 pages
2h 28m
English
| Puzzle 9 | Out of Order |
| | fn main() { |
| | let mut floats = vec![3.1, 1.2, 4.5, 0.3]; |
| | floats.sort(); |
| | |
| | println!("{:#?}", floats); |
| | } |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
The program will fail to compile, and you’ll receive the following error message:
| | the trait `Ord` is not implemented for `{float}` |
Rust makes it easy to sort vectors of most types. A vector’s ...
Read now
Unlock full access