Skip to content

Commit 36341e9

Browse files
committed
rubocop
1 parent 51fafe5 commit 36341e9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/dry/types/coercions.rb

+2-3
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)