Performance/RedundantStringChars: Does not detect string.chars.last
#313
Labels
bug
Something isn't working
string.chars.last
#313
Expected behavior
Expected the cop to report
string.chars.last
and autocorrect it tostring[-1]
.Actual behavior
The cop only corrects
string.chars.first
and does not reportstring.chars.last
as an offense.Steps to reproduce the problem
Create this
rubocop.yml
:Create this
test.rb
file:Run
rubocop
orrubocop -A
. The autocorrected output will be:RuboCop version
The text was updated successfully, but these errors were encountered: