I have the following snippet of code:
if uri.host =~ /tiktok\.com/
And rubocop-performance auto-fixes it like so:
if uri.host.include?('tiktok.com')
However, this doesn't handle the nil case correctly. It should fix like so:
if uri.host&.include?('tiktok.com')
Using latest versions.
I have the following snippet of code:
if uri.host =~ /tiktok\.com/And rubocop-performance auto-fixes it like so:
if uri.host.include?('tiktok.com')However, this doesn't handle the nil case correctly. It should fix like so:
if uri.host&.include?('tiktok.com')Using latest versions.