fork download
  1. use std::cmp::Ordering;
  2.  
  3. impl Solution {
  4.  
  5. pub fn move_zeroes(nums: &mut Vec<i32>) {
  6. nums.sort_by(|a,b| {
  7. if a == b {
  8. Ordering::Equal
  9. }
  10. else if a == &0 {
  11. Ordering::Greater
  12. }
  13. else if b == &0 {
  14. Ordering::Less
  15. }
  16. else {
  17. Ordering::Equal
  18. }
  19. })
  20. }
  21.  
  22. }
  23.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
error[E0412]: cannot find type `Solution` in this scope
 --> prog.rs:3:6
  |
3 | impl Solution {
  |      ^^^^^^^^ not found in this scope

error[E0601]: `main` function not found in crate `prog`
  |
  = note: consider adding a `main` function to `prog.rs`

error: aborting due to 2 previous errors

Some errors occurred: E0412, E0601.
For more information about an error, try `rustc --explain E0412`.
stdout
Standard output is empty