diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2019-02-08 15:19:53 +0300 |
---|---|---|
committer | Andrew Newdigate <andrew@gitlab.com> | 2019-03-06 18:51:56 +0300 |
commit | 3288e1a874ec0184f9f27f932748e51c57babf17 (patch) | |
tree | 9f8667f5349ecfc59f3c8a6e9641cb1e32fa3d5b /lib/gitlab/email | |
parent | 7bbdb2a29fbc7b8c9f879c42de7063adaa8313c7 (diff) |
Adds the Rubocop ReturnNil cop
This style change enforces `return if ...` instead of
`return nil if ...` to save maintainers a few minor review points
Diffstat (limited to 'lib/gitlab/email')
-rw-r--r-- | lib/gitlab/email/reply_parser.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/email/reply_parser.rb b/lib/gitlab/email/reply_parser.rb index 2743f011ca6..dc44e9d7481 100644 --- a/lib/gitlab/email/reply_parser.rb +++ b/lib/gitlab/email/reply_parser.rb @@ -61,7 +61,7 @@ module Gitlab # Force encoding to UTF-8 on a Mail::Message or Mail::Part def fix_charset(object) - return nil if object.nil? + return if object.nil? if object.charset object.body.decoded.force_encoding(object.charset.gsub(/utf8/i, "UTF-8")).encode("UTF-8").to_s |