fix array index crash
Summary:
I didn't realize Rust does runtime check for over flow, so the the trick won't work. In the previous implementation, I tried to depend on the "wrap around" behavior of over flowed subtraction operation.
Given usize is return by `len()` and `i >= 0` is always `true`, let `i` be the current length seems the easiest implementation.
```
fn rfind(s: &[u8], needle: u8) -> Option<usize> {
let mut i = s.len();
while i > 0 {
i -= 1;
if s[i] == needle {
return Some(i);
}
}
None
}
```
Reviewed By: losvald
Differential Revision:
D18219014
fbshipit-source-id:
0d0ce8ea744e2ed30c2702c40a67ad7fd6270e2f