Skip to content

Commit c198fcc

Browse files
committed
♻️ Use Integer.try_convert (new in ruby 3.1+)
Now that the minimum ruby version is v3.1.0, we can use Integer.try_convert.
1 parent 74a39b9 commit c198fcc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/net/imap/sequence_set.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,8 +1284,7 @@ def input_to_tuples(obj)
12841284
# String, Set, Array, or... any type of object.
12851285
def input_try_convert(input)
12861286
SequenceSet.try_convert(input) ||
1287-
# Integer.try_convert(input) || # ruby 3.1+
1288-
input.respond_to?(:to_int) && Integer(input.to_int) ||
1287+
Integer.try_convert(input) ||
12891288
String.try_convert(input) ||
12901289
input
12911290
end

0 commit comments

Comments
 (0)