Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yep, you could change the asserted length and it would succeed:

  assert_eq!(array, [0, 1, 2]);
If you tried both—

  assert_eq!(array, [0, 1, 2]);
  assert_eq!(array, [0, 1, 2, 3, 4]);
—the assertions would never run because it wouldn’t even compile:

  error[E0277]: can't compare `[usize; 3]` with `[{integer}; 5]`


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: