Improve indexing_slicing
help message
#2866
Labels
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
L-suggestion
Lint: Improving, adding or fixing lint suggestions
The help message reported by the
indexing_slicing
lint could be improved to be more specific. Currently its reports are relatively generic suggestions, i.e.slicing may panic. Consider using .get(..n) or .get_mut(..n) instead
.It would be useful if we figured out whether
get()
orget_mut()
were the right function to suggest and reported the index/span's actual value. After these changes the above example might look something likeslicing may panic. Consider using .get_mut(..3) instead
The text was updated successfully, but these errors were encountered: