Inspectopedia
 
2024.3

Redundant 'return' statement

Warning
New
Last modified: 03 December 2024

Reports redundant return keywords and statements. A return keyword is not necessary for the last value in methods and control flow statements.

Since Ruby 1.8, return statements inside assignment methods are redundant because the return value is always equal to the parameter value.