fix rubocop warning 'UselessAssignment'