Ruby

Ruby

Made by DeepSource

Inconsistent use of safe navigation detected RB-RL1049

Style
Major
Autofix

By default, this issue is raised when using try! in place of &.. try can be detected, too, if configured in .rubocop.yml.

For example, if try is detected too

Bad practice

foo.try!(:bar)
foo.try(:bar) { |e| e.baz }

Recommended

foo&.bar
foo&.bar { |e| e.baz }