Skip to content

Commit c778e7d

Browse files
committed
rubocop
1 parent 51fafe5 commit c778e7d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ end
1818

1919
group :benchmarks do
2020
platform :mri do
21+
gem "activemodel"
2122
gem "attrio"
2223
gem "benchmark-ips"
2324
gem "fast_attributes"
2425
gem "hotch"
2526
gem "virtus"
26-
gem "activemodel"
2727
end
2828
end

lib/dry/types/coercions.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def empty_str?(value)
103103
EMPTY_STRING.eql?(value)
104104
end
105105

106-
ISO_DATE = /\A(\d{4})-(\d\d)-(\d\d)\z/
106+
ISO_DATE = /\A(\d{4})-(\d\d)-(\d\d)\z/.freeze
107107
def fast_string_to_date(string)
108108
if string =~ ISO_DATE
109109
::Date.new $1.to_i, $2.to_i, $3.to_i
@@ -116,7 +116,7 @@ def fast_string_to_date(string)
116116
(\d\d):(\d\d):(\d\d)(?:\.(\d{1,6})\d*)? # 10:20:30.123456
117117
(?:(Z(?=\z)|[+-]\d\d)(?::?(\d\d))?)? # +09:00
118118
\z
119-
/x
119+
/x.freeze
120120
def fast_string_to_time(string)
121121
return unless ISO_DATETIME =~ string
122122

@@ -132,7 +132,6 @@ def fast_string_to_time(string)
132132

133133
::Time.local($1.to_i, $2.to_i, $3.to_i, $4.to_i, $5.to_i, $6.to_i, usec, offset)
134134
end
135-
136135
end
137136
end
138137
end

0 commit comments

Comments
 (0)