2 Checks for using `x.get(x.len() - 1)` instead of
6 Using `x.last()` is easier to read and has the same
9 Note that using `x[x.len() - 1]` is semantically different from
10 `x.last()`. Indexing into the array will panic on out-of-bounds
11 accesses, while `x.get()` and `x.last()` will return `None`.
13 There is another lint (get_unwrap) that covers the case of using
14 `x.get(index).unwrap()` instead of `x[index]`.
18 let x = vec![2, 3, 5];
19 let last_element = x.get(x.len() - 1);
24 let x = vec![2, 3, 5];
25 let last_element = x.last();