Use bang variants in couple of places more

This commit is contained in:
Sijawusz Pur Rahnama 2022-12-08 13:59:42 +01:00
parent 5ab4b05add
commit 784e3ac616

View file

@ -59,7 +59,7 @@ module Ameba::Rule::Style
private def allowed?(_sign, value, fraction, _suffix)
return true if fraction && fraction.size > 3
digits = value.chars.select(&.number?)
digits = value.chars.select!(&.number?)
digits.size >= int_min_digits
end
@ -72,7 +72,7 @@ module Ameba::Rule::Style
private def slice_digits(value, by = 3)
%w[].tap do |slices|
value.chars.reject(&.== '_').each_slice(by) do |slice|
value.chars.reject!(&.== '_').each_slice(by) do |slice|
slices << slice.join
end
end.join('_')